fleethub-core 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/fleethub_core.d.ts +19 -10
- package/node/fleethub_core.js +41 -85
- package/node/fleethub_core_bg.wasm +0 -0
- package/node/fleethub_core_bg.wasm.d.ts +4 -2
- package/package.json +3 -3
- package/pkg/fleethub_core.d.ts +19 -10
- package/pkg/fleethub_core_bg.js +41 -85
- package/pkg/fleethub_core_bg.wasm +0 -0
- package/pkg/fleethub_core_bg.wasm.d.ts +4 -2
package/node/fleethub_core.d.ts
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
*/
|
|
5
5
|
export function set_panic_hook(): void;
|
|
6
|
-
export interface
|
|
7
|
-
gear_id: number;
|
|
8
|
-
types: GearTypeIdArray;
|
|
6
|
+
export interface EBonuses {
|
|
9
7
|
firepower: number;
|
|
10
8
|
torpedo: number;
|
|
11
9
|
anti_air: number;
|
|
@@ -16,19 +14,18 @@ export interface EBonusFnGearInput {
|
|
|
16
14
|
bombing: number;
|
|
17
15
|
accuracy: number;
|
|
18
16
|
range: number;
|
|
19
|
-
radius: number;
|
|
20
|
-
stars: number;
|
|
21
|
-
ace: number;
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
export interface
|
|
19
|
+
export interface ShipInput {
|
|
25
20
|
ship_id: number;
|
|
26
21
|
ctype: number;
|
|
27
22
|
stype: number;
|
|
28
23
|
yomi: string;
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
export interface
|
|
26
|
+
export interface GearInput {
|
|
27
|
+
gear_id: number;
|
|
28
|
+
types: GearTypeIdArray;
|
|
32
29
|
firepower: number;
|
|
33
30
|
torpedo: number;
|
|
34
31
|
anti_air: number;
|
|
@@ -39,8 +36,13 @@ export interface EBonuses {
|
|
|
39
36
|
bombing: number;
|
|
40
37
|
accuracy: number;
|
|
41
38
|
range: number;
|
|
39
|
+
radius: number;
|
|
40
|
+
stars: number;
|
|
41
|
+
ace: number;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
export type GearVecInput = GearInput[];
|
|
45
|
+
|
|
44
46
|
export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
|
|
45
47
|
|
|
46
48
|
export type AirState =
|
|
@@ -1072,9 +1074,8 @@ export class FhCore {
|
|
|
1072
1074
|
free(): void;
|
|
1073
1075
|
/**
|
|
1074
1076
|
* @param {MasterData} js_master
|
|
1075
|
-
* @param {Function} js_fn
|
|
1076
1077
|
*/
|
|
1077
|
-
constructor(js_master: MasterData
|
|
1078
|
+
constructor(js_master: MasterData);
|
|
1078
1079
|
/**
|
|
1079
1080
|
* @param {GearState | undefined} input
|
|
1080
1081
|
* @returns {Gear | undefined}
|
|
@@ -1105,6 +1106,10 @@ export class FhCore {
|
|
|
1105
1106
|
* @returns {Ship | undefined}
|
|
1106
1107
|
*/
|
|
1107
1108
|
create_ship_by_id(ship_id: number): Ship | undefined;
|
|
1109
|
+
/**
|
|
1110
|
+
* @returns {Ship[]}
|
|
1111
|
+
*/
|
|
1112
|
+
create_all_ships(): Ship[];
|
|
1108
1113
|
/**
|
|
1109
1114
|
* @param {Uint16Array} main
|
|
1110
1115
|
* @param {Uint16Array | undefined} escort
|
|
@@ -1977,6 +1982,10 @@ export class Ship {
|
|
|
1977
1982
|
* @returns {number | undefined}
|
|
1978
1983
|
*/
|
|
1979
1984
|
readonly torpedo: number | undefined;
|
|
1985
|
+
/**
|
|
1986
|
+
* @returns {number}
|
|
1987
|
+
*/
|
|
1988
|
+
readonly torpedo_accuracy_mod: number;
|
|
1980
1989
|
/**
|
|
1981
1990
|
* @returns {boolean}
|
|
1982
1991
|
*/
|
package/node/fleethub_core.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
let imports = {};
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
|
+
const { createEquipmentBonuses } = require(`equipment-bonus`);
|
|
4
5
|
const { TextEncoder, TextDecoder } = require(`util`);
|
|
5
6
|
|
|
6
7
|
const heap = new Array(32).fill(undefined);
|
|
@@ -111,71 +112,6 @@ function addHeapObject(obj) {
|
|
|
111
112
|
return idx;
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
function debugString(val) {
|
|
115
|
-
// primitive types
|
|
116
|
-
const type = typeof val;
|
|
117
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
118
|
-
return `${val}`;
|
|
119
|
-
}
|
|
120
|
-
if (type == 'string') {
|
|
121
|
-
return `"${val}"`;
|
|
122
|
-
}
|
|
123
|
-
if (type == 'symbol') {
|
|
124
|
-
const description = val.description;
|
|
125
|
-
if (description == null) {
|
|
126
|
-
return 'Symbol';
|
|
127
|
-
} else {
|
|
128
|
-
return `Symbol(${description})`;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (type == 'function') {
|
|
132
|
-
const name = val.name;
|
|
133
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
134
|
-
return `Function(${name})`;
|
|
135
|
-
} else {
|
|
136
|
-
return 'Function';
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// objects
|
|
140
|
-
if (Array.isArray(val)) {
|
|
141
|
-
const length = val.length;
|
|
142
|
-
let debug = '[';
|
|
143
|
-
if (length > 0) {
|
|
144
|
-
debug += debugString(val[0]);
|
|
145
|
-
}
|
|
146
|
-
for(let i = 1; i < length; i++) {
|
|
147
|
-
debug += ', ' + debugString(val[i]);
|
|
148
|
-
}
|
|
149
|
-
debug += ']';
|
|
150
|
-
return debug;
|
|
151
|
-
}
|
|
152
|
-
// Test for built-in
|
|
153
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
154
|
-
let className;
|
|
155
|
-
if (builtInMatches.length > 1) {
|
|
156
|
-
className = builtInMatches[1];
|
|
157
|
-
} else {
|
|
158
|
-
// Failed to match the standard '[object ClassName]'
|
|
159
|
-
return toString.call(val);
|
|
160
|
-
}
|
|
161
|
-
if (className == 'Object') {
|
|
162
|
-
// we're a user defined class or Object
|
|
163
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
164
|
-
// easier than looping through ownProperties of `val`.
|
|
165
|
-
try {
|
|
166
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
167
|
-
} catch (_) {
|
|
168
|
-
return 'Object';
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
// errors
|
|
172
|
-
if (val instanceof Error) {
|
|
173
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
174
|
-
}
|
|
175
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
176
|
-
return className;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
115
|
const u32CvtShim = new Uint32Array(2);
|
|
180
116
|
|
|
181
117
|
const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
|
|
@@ -228,11 +164,6 @@ function getUint16Memory0() {
|
|
|
228
164
|
function getArrayU16FromWasm0(ptr, len) {
|
|
229
165
|
return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
|
|
230
166
|
}
|
|
231
|
-
/**
|
|
232
|
-
*/
|
|
233
|
-
module.exports.set_panic_hook = function() {
|
|
234
|
-
wasm.set_panic_hook();
|
|
235
|
-
};
|
|
236
167
|
|
|
237
168
|
function passArray16ToWasm0(arg, malloc) {
|
|
238
169
|
const ptr = malloc(arg.length * 2);
|
|
@@ -251,6 +182,11 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
251
182
|
WASM_VECTOR_LEN = arg.length;
|
|
252
183
|
return ptr;
|
|
253
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
*/
|
|
187
|
+
module.exports.set_panic_hook = function() {
|
|
188
|
+
wasm.set_panic_hook();
|
|
189
|
+
};
|
|
254
190
|
|
|
255
191
|
function handleError(f, args) {
|
|
256
192
|
try {
|
|
@@ -815,12 +751,11 @@ class FhCore {
|
|
|
815
751
|
}
|
|
816
752
|
/**
|
|
817
753
|
* @param {MasterData} js_master
|
|
818
|
-
* @param {Function} js_fn
|
|
819
754
|
*/
|
|
820
|
-
constructor(js_master
|
|
755
|
+
constructor(js_master) {
|
|
821
756
|
try {
|
|
822
757
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
823
|
-
wasm.fhcore_new(retptr, addHeapObject(js_master)
|
|
758
|
+
wasm.fhcore_new(retptr, addHeapObject(js_master));
|
|
824
759
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
825
760
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
826
761
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -881,6 +816,13 @@ class FhCore {
|
|
|
881
816
|
return ret === 0 ? undefined : Ship.__wrap(ret);
|
|
882
817
|
}
|
|
883
818
|
/**
|
|
819
|
+
* @returns {Ship[]}
|
|
820
|
+
*/
|
|
821
|
+
create_all_ships() {
|
|
822
|
+
const ret = wasm.fhcore_create_all_ships(this.ptr);
|
|
823
|
+
return takeObject(ret);
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
884
826
|
* @param {Uint16Array} main
|
|
885
827
|
* @param {Uint16Array | undefined} escort
|
|
886
828
|
* @returns {Comp}
|
|
@@ -3103,6 +3045,13 @@ class Ship {
|
|
|
3103
3045
|
return ret;
|
|
3104
3046
|
}
|
|
3105
3047
|
/**
|
|
3048
|
+
* @returns {number}
|
|
3049
|
+
*/
|
|
3050
|
+
get torpedo_accuracy_mod() {
|
|
3051
|
+
const ret = wasm.ship_torpedo_accuracy_mod(this.ptr);
|
|
3052
|
+
return ret;
|
|
3053
|
+
}
|
|
3054
|
+
/**
|
|
3106
3055
|
* @returns {boolean}
|
|
3107
3056
|
*/
|
|
3108
3057
|
is_installation() {
|
|
@@ -3281,10 +3230,20 @@ class Ship {
|
|
|
3281
3230
|
}
|
|
3282
3231
|
module.exports.Ship = Ship;
|
|
3283
3232
|
|
|
3233
|
+
module.exports.__wbg_ship_new = function(arg0) {
|
|
3234
|
+
const ret = Ship.__wrap(arg0);
|
|
3235
|
+
return addHeapObject(ret);
|
|
3236
|
+
};
|
|
3237
|
+
|
|
3284
3238
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
3285
3239
|
takeObject(arg0);
|
|
3286
3240
|
};
|
|
3287
3241
|
|
|
3242
|
+
module.exports.__wbg_createEquipmentBonuses_273b5cec732de9f9 = function(arg0, arg1) {
|
|
3243
|
+
const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
|
|
3244
|
+
return addHeapObject(ret);
|
|
3245
|
+
};
|
|
3246
|
+
|
|
3288
3247
|
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
3289
3248
|
const obj = getObject(arg1);
|
|
3290
3249
|
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
@@ -3379,6 +3338,11 @@ module.exports.__wbg_msCrypto_d07655bf62361f21 = function(arg0) {
|
|
|
3379
3338
|
return addHeapObject(ret);
|
|
3380
3339
|
};
|
|
3381
3340
|
|
|
3341
|
+
module.exports.__wbg_new_94fb1279cf6afea5 = function() {
|
|
3342
|
+
const ret = new Array();
|
|
3343
|
+
return addHeapObject(ret);
|
|
3344
|
+
};
|
|
3345
|
+
|
|
3382
3346
|
module.exports.__wbg_newnoargs_e23b458e372830de = function(arg0, arg1) {
|
|
3383
3347
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
3384
3348
|
return addHeapObject(ret);
|
|
@@ -3394,10 +3358,10 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
|
3394
3358
|
return addHeapObject(ret);
|
|
3395
3359
|
};
|
|
3396
3360
|
|
|
3397
|
-
module.exports.
|
|
3398
|
-
const ret = getObject(arg0).
|
|
3399
|
-
return
|
|
3400
|
-
}
|
|
3361
|
+
module.exports.__wbg_push_40c6a90f1805aa90 = function(arg0, arg1) {
|
|
3362
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
3363
|
+
return ret;
|
|
3364
|
+
};
|
|
3401
3365
|
|
|
3402
3366
|
module.exports.__wbg_self_99737b4dcdf6f0d8 = function() { return handleError(function () {
|
|
3403
3367
|
const ret = self.self;
|
|
@@ -3453,14 +3417,6 @@ module.exports.__wbg_subarray_da527dbd24eafb6b = function(arg0, arg1, arg2) {
|
|
|
3453
3417
|
return addHeapObject(ret);
|
|
3454
3418
|
};
|
|
3455
3419
|
|
|
3456
|
-
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
3457
|
-
const ret = debugString(getObject(arg1));
|
|
3458
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3459
|
-
const len0 = WASM_VECTOR_LEN;
|
|
3460
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
3461
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
3462
|
-
};
|
|
3463
|
-
|
|
3464
3420
|
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
3465
3421
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3466
3422
|
};
|
|
Binary file
|
|
@@ -78,6 +78,7 @@ export function ship_luck(a: number): number;
|
|
|
78
78
|
export function ship_range(a: number): number;
|
|
79
79
|
export function ship_speed(a: number): number;
|
|
80
80
|
export function ship_accuracy(a: number): number;
|
|
81
|
+
export function ship_torpedo_accuracy_mod(a: number): number;
|
|
81
82
|
export function ship_is_installation(a: number): number;
|
|
82
83
|
export function ship_get_slot_size(a: number, b: number): number;
|
|
83
84
|
export function ship_get_max_slot_size(a: number, b: number): number;
|
|
@@ -207,18 +208,18 @@ export function fleet_expedition_bonus(a: number): number;
|
|
|
207
208
|
export function fleet_sum_ship_stat_by(a: number, b: number, c: number, d: number): void;
|
|
208
209
|
export function fleet_reset_battle_state(a: number): void;
|
|
209
210
|
export function __wbg_fhcore_free(a: number): void;
|
|
210
|
-
export function fhcore_new(a: number, b: number
|
|
211
|
+
export function fhcore_new(a: number, b: number): void;
|
|
211
212
|
export function fhcore_create_gear(a: number, b: number): number;
|
|
212
213
|
export function fhcore_create_ship(a: number, b: number): number;
|
|
213
214
|
export function fhcore_create_air_squadron(a: number, b: number): number;
|
|
214
215
|
export function fhcore_create_fleet(a: number, b: number): number;
|
|
215
216
|
export function fhcore_create_org(a: number, b: number): number;
|
|
216
217
|
export function fhcore_create_ship_by_id(a: number, b: number): number;
|
|
218
|
+
export function fhcore_create_all_ships(a: number): number;
|
|
217
219
|
export function fhcore_create_comp_by_map_enemy(a: number, b: number, c: number, d: number, e: number): number;
|
|
218
220
|
export function fhcore_create_default_ship(a: number): number;
|
|
219
221
|
export function fhcore_create_analyzer(a: number): number;
|
|
220
222
|
export function fhcore_simulate_shelling_support(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
221
|
-
export function set_panic_hook(): void;
|
|
222
223
|
export function __wbg_ibonuses_free(a: number): void;
|
|
223
224
|
export function __wbg_get_ibonuses_shelling_power(a: number): number;
|
|
224
225
|
export function __wbg_set_ibonuses_shelling_power(a: number, b: number): void;
|
|
@@ -335,6 +336,7 @@ export function gear_is_abyssal_patrolling_attack_hawk(a: number): number;
|
|
|
335
336
|
export function gear_expedition_bonus(a: number): number;
|
|
336
337
|
export function gear_can_be_deployed_to_land_base(a: number): number;
|
|
337
338
|
export function gear_has_proficiency(a: number): number;
|
|
339
|
+
export function set_panic_hook(): void;
|
|
338
340
|
export function __wbindgen_malloc(a: number): number;
|
|
339
341
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
340
342
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fleethub-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"collaborators": [
|
|
17
17
|
"まどの <madonoharu@gmail.com>"
|
|
18
18
|
],
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"equipment-bonus": "*"
|
|
21
21
|
}
|
|
22
22
|
}
|
package/pkg/fleethub_core.d.ts
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
*/
|
|
5
5
|
export function set_panic_hook(): void;
|
|
6
|
-
export interface
|
|
7
|
-
gear_id: number;
|
|
8
|
-
types: GearTypeIdArray;
|
|
6
|
+
export interface EBonuses {
|
|
9
7
|
firepower: number;
|
|
10
8
|
torpedo: number;
|
|
11
9
|
anti_air: number;
|
|
@@ -16,19 +14,18 @@ export interface EBonusFnGearInput {
|
|
|
16
14
|
bombing: number;
|
|
17
15
|
accuracy: number;
|
|
18
16
|
range: number;
|
|
19
|
-
radius: number;
|
|
20
|
-
stars: number;
|
|
21
|
-
ace: number;
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
export interface
|
|
19
|
+
export interface ShipInput {
|
|
25
20
|
ship_id: number;
|
|
26
21
|
ctype: number;
|
|
27
22
|
stype: number;
|
|
28
23
|
yomi: string;
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
export interface
|
|
26
|
+
export interface GearInput {
|
|
27
|
+
gear_id: number;
|
|
28
|
+
types: GearTypeIdArray;
|
|
32
29
|
firepower: number;
|
|
33
30
|
torpedo: number;
|
|
34
31
|
anti_air: number;
|
|
@@ -39,8 +36,13 @@ export interface EBonuses {
|
|
|
39
36
|
bombing: number;
|
|
40
37
|
accuracy: number;
|
|
41
38
|
range: number;
|
|
39
|
+
radius: number;
|
|
40
|
+
stars: number;
|
|
41
|
+
ace: number;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
export type GearVecInput = GearInput[];
|
|
45
|
+
|
|
44
46
|
export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
|
|
45
47
|
|
|
46
48
|
export type AirState =
|
|
@@ -1072,9 +1074,8 @@ export class FhCore {
|
|
|
1072
1074
|
free(): void;
|
|
1073
1075
|
/**
|
|
1074
1076
|
* @param {MasterData} js_master
|
|
1075
|
-
* @param {Function} js_fn
|
|
1076
1077
|
*/
|
|
1077
|
-
constructor(js_master: MasterData
|
|
1078
|
+
constructor(js_master: MasterData);
|
|
1078
1079
|
/**
|
|
1079
1080
|
* @param {GearState | undefined} input
|
|
1080
1081
|
* @returns {Gear | undefined}
|
|
@@ -1105,6 +1106,10 @@ export class FhCore {
|
|
|
1105
1106
|
* @returns {Ship | undefined}
|
|
1106
1107
|
*/
|
|
1107
1108
|
create_ship_by_id(ship_id: number): Ship | undefined;
|
|
1109
|
+
/**
|
|
1110
|
+
* @returns {Ship[]}
|
|
1111
|
+
*/
|
|
1112
|
+
create_all_ships(): Ship[];
|
|
1108
1113
|
/**
|
|
1109
1114
|
* @param {Uint16Array} main
|
|
1110
1115
|
* @param {Uint16Array | undefined} escort
|
|
@@ -1977,6 +1982,10 @@ export class Ship {
|
|
|
1977
1982
|
* @returns {number | undefined}
|
|
1978
1983
|
*/
|
|
1979
1984
|
readonly torpedo: number | undefined;
|
|
1985
|
+
/**
|
|
1986
|
+
* @returns {number}
|
|
1987
|
+
*/
|
|
1988
|
+
readonly torpedo_accuracy_mod: number;
|
|
1980
1989
|
/**
|
|
1981
1990
|
* @returns {boolean}
|
|
1982
1991
|
*/
|
package/pkg/fleethub_core_bg.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createEquipmentBonuses } from 'equipment-bonus';
|
|
1
2
|
import * as wasm from './fleethub_core_bg.wasm';
|
|
2
3
|
|
|
3
4
|
const heap = new Array(32).fill(undefined);
|
|
@@ -112,71 +113,6 @@ function addHeapObject(obj) {
|
|
|
112
113
|
return idx;
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
function debugString(val) {
|
|
116
|
-
// primitive types
|
|
117
|
-
const type = typeof val;
|
|
118
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
119
|
-
return `${val}`;
|
|
120
|
-
}
|
|
121
|
-
if (type == 'string') {
|
|
122
|
-
return `"${val}"`;
|
|
123
|
-
}
|
|
124
|
-
if (type == 'symbol') {
|
|
125
|
-
const description = val.description;
|
|
126
|
-
if (description == null) {
|
|
127
|
-
return 'Symbol';
|
|
128
|
-
} else {
|
|
129
|
-
return `Symbol(${description})`;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (type == 'function') {
|
|
133
|
-
const name = val.name;
|
|
134
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
135
|
-
return `Function(${name})`;
|
|
136
|
-
} else {
|
|
137
|
-
return 'Function';
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
// objects
|
|
141
|
-
if (Array.isArray(val)) {
|
|
142
|
-
const length = val.length;
|
|
143
|
-
let debug = '[';
|
|
144
|
-
if (length > 0) {
|
|
145
|
-
debug += debugString(val[0]);
|
|
146
|
-
}
|
|
147
|
-
for(let i = 1; i < length; i++) {
|
|
148
|
-
debug += ', ' + debugString(val[i]);
|
|
149
|
-
}
|
|
150
|
-
debug += ']';
|
|
151
|
-
return debug;
|
|
152
|
-
}
|
|
153
|
-
// Test for built-in
|
|
154
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
155
|
-
let className;
|
|
156
|
-
if (builtInMatches.length > 1) {
|
|
157
|
-
className = builtInMatches[1];
|
|
158
|
-
} else {
|
|
159
|
-
// Failed to match the standard '[object ClassName]'
|
|
160
|
-
return toString.call(val);
|
|
161
|
-
}
|
|
162
|
-
if (className == 'Object') {
|
|
163
|
-
// we're a user defined class or Object
|
|
164
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
165
|
-
// easier than looping through ownProperties of `val`.
|
|
166
|
-
try {
|
|
167
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
168
|
-
} catch (_) {
|
|
169
|
-
return 'Object';
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
// errors
|
|
173
|
-
if (val instanceof Error) {
|
|
174
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
175
|
-
}
|
|
176
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
177
|
-
return className;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
116
|
const u32CvtShim = new Uint32Array(2);
|
|
181
117
|
|
|
182
118
|
const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
|
|
@@ -229,11 +165,6 @@ function getUint16Memory0() {
|
|
|
229
165
|
function getArrayU16FromWasm0(ptr, len) {
|
|
230
166
|
return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
|
|
231
167
|
}
|
|
232
|
-
/**
|
|
233
|
-
*/
|
|
234
|
-
export function set_panic_hook() {
|
|
235
|
-
wasm.set_panic_hook();
|
|
236
|
-
}
|
|
237
168
|
|
|
238
169
|
function passArray16ToWasm0(arg, malloc) {
|
|
239
170
|
const ptr = malloc(arg.length * 2);
|
|
@@ -252,6 +183,11 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
252
183
|
WASM_VECTOR_LEN = arg.length;
|
|
253
184
|
return ptr;
|
|
254
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
*/
|
|
188
|
+
export function set_panic_hook() {
|
|
189
|
+
wasm.set_panic_hook();
|
|
190
|
+
}
|
|
255
191
|
|
|
256
192
|
function handleError(f, args) {
|
|
257
193
|
try {
|
|
@@ -813,12 +749,11 @@ export class FhCore {
|
|
|
813
749
|
}
|
|
814
750
|
/**
|
|
815
751
|
* @param {MasterData} js_master
|
|
816
|
-
* @param {Function} js_fn
|
|
817
752
|
*/
|
|
818
|
-
constructor(js_master
|
|
753
|
+
constructor(js_master) {
|
|
819
754
|
try {
|
|
820
755
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
821
|
-
wasm.fhcore_new(retptr, addHeapObject(js_master)
|
|
756
|
+
wasm.fhcore_new(retptr, addHeapObject(js_master));
|
|
822
757
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
823
758
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
824
759
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -879,6 +814,13 @@ export class FhCore {
|
|
|
879
814
|
return ret === 0 ? undefined : Ship.__wrap(ret);
|
|
880
815
|
}
|
|
881
816
|
/**
|
|
817
|
+
* @returns {Ship[]}
|
|
818
|
+
*/
|
|
819
|
+
create_all_ships() {
|
|
820
|
+
const ret = wasm.fhcore_create_all_ships(this.ptr);
|
|
821
|
+
return takeObject(ret);
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
882
824
|
* @param {Uint16Array} main
|
|
883
825
|
* @param {Uint16Array | undefined} escort
|
|
884
826
|
* @returns {Comp}
|
|
@@ -3096,6 +3038,13 @@ export class Ship {
|
|
|
3096
3038
|
return ret;
|
|
3097
3039
|
}
|
|
3098
3040
|
/**
|
|
3041
|
+
* @returns {number}
|
|
3042
|
+
*/
|
|
3043
|
+
get torpedo_accuracy_mod() {
|
|
3044
|
+
const ret = wasm.ship_torpedo_accuracy_mod(this.ptr);
|
|
3045
|
+
return ret;
|
|
3046
|
+
}
|
|
3047
|
+
/**
|
|
3099
3048
|
* @returns {boolean}
|
|
3100
3049
|
*/
|
|
3101
3050
|
is_installation() {
|
|
@@ -3273,10 +3222,20 @@ export class Ship {
|
|
|
3273
3222
|
}
|
|
3274
3223
|
}
|
|
3275
3224
|
|
|
3225
|
+
export function __wbg_ship_new(arg0) {
|
|
3226
|
+
const ret = Ship.__wrap(arg0);
|
|
3227
|
+
return addHeapObject(ret);
|
|
3228
|
+
};
|
|
3229
|
+
|
|
3276
3230
|
export function __wbindgen_object_drop_ref(arg0) {
|
|
3277
3231
|
takeObject(arg0);
|
|
3278
3232
|
};
|
|
3279
3233
|
|
|
3234
|
+
export function __wbg_createEquipmentBonuses_273b5cec732de9f9(arg0, arg1) {
|
|
3235
|
+
const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
|
|
3236
|
+
return addHeapObject(ret);
|
|
3237
|
+
};
|
|
3238
|
+
|
|
3280
3239
|
export function __wbindgen_json_serialize(arg0, arg1) {
|
|
3281
3240
|
const obj = getObject(arg1);
|
|
3282
3241
|
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
@@ -3371,6 +3330,11 @@ export function __wbg_msCrypto_d07655bf62361f21(arg0) {
|
|
|
3371
3330
|
return addHeapObject(ret);
|
|
3372
3331
|
};
|
|
3373
3332
|
|
|
3333
|
+
export function __wbg_new_94fb1279cf6afea5() {
|
|
3334
|
+
const ret = new Array();
|
|
3335
|
+
return addHeapObject(ret);
|
|
3336
|
+
};
|
|
3337
|
+
|
|
3374
3338
|
export function __wbg_newnoargs_e23b458e372830de(arg0, arg1) {
|
|
3375
3339
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
3376
3340
|
return addHeapObject(ret);
|
|
@@ -3386,10 +3350,10 @@ export function __wbindgen_object_clone_ref(arg0) {
|
|
|
3386
3350
|
return addHeapObject(ret);
|
|
3387
3351
|
};
|
|
3388
3352
|
|
|
3389
|
-
export function
|
|
3390
|
-
const ret = getObject(arg0).
|
|
3391
|
-
return
|
|
3392
|
-
}
|
|
3353
|
+
export function __wbg_push_40c6a90f1805aa90(arg0, arg1) {
|
|
3354
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
3355
|
+
return ret;
|
|
3356
|
+
};
|
|
3393
3357
|
|
|
3394
3358
|
export function __wbg_self_99737b4dcdf6f0d8() { return handleError(function () {
|
|
3395
3359
|
const ret = self.self;
|
|
@@ -3445,14 +3409,6 @@ export function __wbg_subarray_da527dbd24eafb6b(arg0, arg1, arg2) {
|
|
|
3445
3409
|
return addHeapObject(ret);
|
|
3446
3410
|
};
|
|
3447
3411
|
|
|
3448
|
-
export function __wbindgen_debug_string(arg0, arg1) {
|
|
3449
|
-
const ret = debugString(getObject(arg1));
|
|
3450
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3451
|
-
const len0 = WASM_VECTOR_LEN;
|
|
3452
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
3453
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
3454
|
-
};
|
|
3455
|
-
|
|
3456
3412
|
export function __wbindgen_throw(arg0, arg1) {
|
|
3457
3413
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3458
3414
|
};
|
|
Binary file
|
|
@@ -78,6 +78,7 @@ export function ship_luck(a: number): number;
|
|
|
78
78
|
export function ship_range(a: number): number;
|
|
79
79
|
export function ship_speed(a: number): number;
|
|
80
80
|
export function ship_accuracy(a: number): number;
|
|
81
|
+
export function ship_torpedo_accuracy_mod(a: number): number;
|
|
81
82
|
export function ship_is_installation(a: number): number;
|
|
82
83
|
export function ship_get_slot_size(a: number, b: number): number;
|
|
83
84
|
export function ship_get_max_slot_size(a: number, b: number): number;
|
|
@@ -207,18 +208,18 @@ export function fleet_expedition_bonus(a: number): number;
|
|
|
207
208
|
export function fleet_sum_ship_stat_by(a: number, b: number, c: number, d: number): void;
|
|
208
209
|
export function fleet_reset_battle_state(a: number): void;
|
|
209
210
|
export function __wbg_fhcore_free(a: number): void;
|
|
210
|
-
export function fhcore_new(a: number, b: number
|
|
211
|
+
export function fhcore_new(a: number, b: number): void;
|
|
211
212
|
export function fhcore_create_gear(a: number, b: number): number;
|
|
212
213
|
export function fhcore_create_ship(a: number, b: number): number;
|
|
213
214
|
export function fhcore_create_air_squadron(a: number, b: number): number;
|
|
214
215
|
export function fhcore_create_fleet(a: number, b: number): number;
|
|
215
216
|
export function fhcore_create_org(a: number, b: number): number;
|
|
216
217
|
export function fhcore_create_ship_by_id(a: number, b: number): number;
|
|
218
|
+
export function fhcore_create_all_ships(a: number): number;
|
|
217
219
|
export function fhcore_create_comp_by_map_enemy(a: number, b: number, c: number, d: number, e: number): number;
|
|
218
220
|
export function fhcore_create_default_ship(a: number): number;
|
|
219
221
|
export function fhcore_create_analyzer(a: number): number;
|
|
220
222
|
export function fhcore_simulate_shelling_support(a: number, b: number, c: number, d: number, e: number, f: number): void;
|
|
221
|
-
export function set_panic_hook(): void;
|
|
222
223
|
export function __wbg_ibonuses_free(a: number): void;
|
|
223
224
|
export function __wbg_get_ibonuses_shelling_power(a: number): number;
|
|
224
225
|
export function __wbg_set_ibonuses_shelling_power(a: number, b: number): void;
|
|
@@ -335,6 +336,7 @@ export function gear_is_abyssal_patrolling_attack_hawk(a: number): number;
|
|
|
335
336
|
export function gear_expedition_bonus(a: number): number;
|
|
336
337
|
export function gear_can_be_deployed_to_land_base(a: number): number;
|
|
337
338
|
export function gear_has_proficiency(a: number): number;
|
|
339
|
+
export function set_panic_hook(): void;
|
|
338
340
|
export function __wbindgen_malloc(a: number): number;
|
|
339
341
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
340
342
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|