fleethub-core 1.3.0 → 1.3.3

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.
@@ -1,40 +1,13 @@
1
1
  import * as wasm from './fleethub_core_bg.wasm';
2
2
 
3
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
4
-
5
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
6
-
7
- cachedTextDecoder.decode();
8
-
9
- let cachegetUint8Memory0 = null;
10
- function getUint8Memory0() {
11
- if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
12
- cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
13
- }
14
- return cachegetUint8Memory0;
15
- }
16
-
17
- function getStringFromWasm0(ptr, len) {
18
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
19
- }
20
-
21
3
  const heap = new Array(32).fill(undefined);
22
4
 
23
5
  heap.push(undefined, null, true, false);
24
6
 
25
- let heap_next = heap.length;
26
-
27
- function addHeapObject(obj) {
28
- if (heap_next === heap.length) heap.push(heap.length + 1);
29
- const idx = heap_next;
30
- heap_next = heap[idx];
31
-
32
- heap[idx] = obj;
33
- return idx;
34
- }
35
-
36
7
  function getObject(idx) { return heap[idx]; }
37
8
 
9
+ let heap_next = heap.length;
10
+
38
11
  function dropObject(idx) {
39
12
  if (idx < 36) return;
40
13
  heap[idx] = heap_next;
@@ -49,6 +22,14 @@ function takeObject(idx) {
49
22
 
50
23
  let WASM_VECTOR_LEN = 0;
51
24
 
25
+ let cachegetUint8Memory0 = null;
26
+ function getUint8Memory0() {
27
+ if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
28
+ cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
29
+ }
30
+ return cachegetUint8Memory0;
31
+ }
32
+
52
33
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
53
34
 
54
35
  let cachedTextEncoder = new lTextEncoder('utf-8');
@@ -112,6 +93,25 @@ function getInt32Memory0() {
112
93
  return cachegetInt32Memory0;
113
94
  }
114
95
 
96
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
97
+
98
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
99
+
100
+ cachedTextDecoder.decode();
101
+
102
+ function getStringFromWasm0(ptr, len) {
103
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
104
+ }
105
+
106
+ function addHeapObject(obj) {
107
+ if (heap_next === heap.length) heap.push(heap.length + 1);
108
+ const idx = heap_next;
109
+ heap_next = heap[idx];
110
+
111
+ heap[idx] = obj;
112
+ return idx;
113
+ }
114
+
115
115
  function debugString(val) {
116
116
  // primitive types
117
117
  const type = typeof val;
@@ -181,6 +181,21 @@ const u32CvtShim = new Uint32Array(2);
181
181
 
182
182
  const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
183
183
 
184
+ function _assertClass(instance, klass) {
185
+ if (!(instance instanceof klass)) {
186
+ throw new Error(`expected instance of ${klass.name}`);
187
+ }
188
+ return instance.ptr;
189
+ }
190
+
191
+ let cachegetFloat64Memory0 = null;
192
+ function getFloat64Memory0() {
193
+ if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
194
+ cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
195
+ }
196
+ return cachegetFloat64Memory0;
197
+ }
198
+
184
199
  function isLikeNone(x) {
185
200
  return x === undefined || x === null;
186
201
  }
@@ -203,14 +218,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
203
218
  return result;
204
219
  }
205
220
 
206
- let cachegetFloat64Memory0 = null;
207
- function getFloat64Memory0() {
208
- if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
209
- cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
210
- }
211
- return cachegetFloat64Memory0;
212
- }
213
-
214
221
  let cachegetUint16Memory0 = null;
215
222
  function getUint16Memory0() {
216
223
  if (cachegetUint16Memory0 === null || cachegetUint16Memory0.buffer !== wasm.memory.buffer) {
@@ -222,68 +229,26 @@ function getUint16Memory0() {
222
229
  function getArrayU16FromWasm0(ptr, len) {
223
230
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
224
231
  }
225
-
226
- function _assertClass(instance, klass) {
227
- if (!(instance instanceof klass)) {
228
- throw new Error(`expected instance of ${klass.name}`);
229
- }
230
- return instance.ptr;
231
- }
232
- /**
233
- * @param {Gear} gear
234
- * @returns {boolean}
235
- */
236
- export function air_squadron_can_equip(gear) {
237
- _assertClass(gear, Gear);
238
- const ret = wasm.air_squadron_can_equip(gear.ptr);
239
- return ret !== 0;
240
- }
241
-
242
232
  /**
243
233
  */
244
234
  export function set_panic_hook() {
245
235
  wasm.set_panic_hook();
246
236
  }
247
237
 
248
- /**
249
- * @param {OrgType} org_type
250
- * @returns {boolean}
251
- */
252
- export function org_type_is_single(org_type) {
253
- const ret = wasm.org_type_is_single(addHeapObject(org_type));
254
- return ret !== 0;
255
- }
256
-
257
- /**
258
- * @param {OrgType} org_type
259
- * @returns {Formation}
260
- */
261
- export function org_type_default_formation(org_type) {
262
- const ret = wasm.org_type_default_formation(addHeapObject(org_type));
263
- return takeObject(ret);
264
- }
265
-
266
- /**
267
- * @param {OrgType} org_type
268
- * @returns {boolean}
269
- */
270
- export function org_type_is_player(org_type) {
271
- const ret = wasm.org_type_is_player(addHeapObject(org_type));
272
- return ret !== 0;
238
+ function passArray16ToWasm0(arg, malloc) {
239
+ const ptr = malloc(arg.length * 2);
240
+ getUint16Memory0().set(arg, ptr / 2);
241
+ WASM_VECTOR_LEN = arg.length;
242
+ return ptr;
273
243
  }
274
244
 
275
- /**
276
- * @param {OrgType} org_type
277
- * @returns {Side}
278
- */
279
- export function org_type_side(org_type) {
280
- const ret = wasm.org_type_side(addHeapObject(org_type));
281
- return takeObject(ret);
245
+ function getArrayU8FromWasm0(ptr, len) {
246
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
282
247
  }
283
248
 
284
- function passArray16ToWasm0(arg, malloc) {
285
- const ptr = malloc(arg.length * 2);
286
- getUint16Memory0().set(arg, ptr / 2);
249
+ function passArray8ToWasm0(arg, malloc) {
250
+ const ptr = malloc(arg.length * 1);
251
+ getUint8Memory0().set(arg, ptr / 1);
287
252
  WASM_VECTOR_LEN = arg.length;
288
253
  return ptr;
289
254
  }
@@ -296,10 +261,6 @@ function handleError(f, args) {
296
261
  }
297
262
  }
298
263
 
299
- function getArrayU8FromWasm0(ptr, len) {
300
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
301
- }
302
-
303
264
  const AirSquadronFinalization = new FinalizationRegistry(ptr => wasm.__wbg_airsquadron_free(ptr));
304
265
  /**
305
266
  */
@@ -393,15 +354,6 @@ export class AirSquadron {
393
354
  return ret === 0 ? undefined : Gear.__wrap(ret);
394
355
  }
395
356
  /**
396
- * @param {Gear} gear
397
- * @returns {boolean}
398
- */
399
- can_equip(gear) {
400
- _assertClass(gear, Gear);
401
- const ret = wasm.airsquadron_can_equip(this.ptr, gear.ptr);
402
- return ret !== 0;
403
- }
404
- /**
405
357
  * @param {number} index
406
358
  * @returns {number}
407
359
  */
@@ -489,14 +441,14 @@ export class Analyzer {
489
441
  /**
490
442
  * @param {Comp} comp
491
443
  * @param {Formation} formation
492
- * @param {number} adjusted_anti_air_resist
444
+ * @param {number} ship_anti_air_resist
493
445
  * @param {number} fleet_anti_air_resist
494
446
  * @param {number | undefined} aaci
495
447
  * @returns {CompAntiAirInfo}
496
448
  */
497
- analyze_anti_air(comp, formation, adjusted_anti_air_resist, fleet_anti_air_resist, aaci) {
449
+ analyze_anti_air(comp, formation, ship_anti_air_resist, fleet_anti_air_resist, aaci) {
498
450
  _assertClass(comp, Comp);
499
- const ret = wasm.analyzer_analyze_anti_air(this.ptr, comp.ptr, addHeapObject(formation), adjusted_anti_air_resist, fleet_anti_air_resist, isLikeNone(aaci) ? 0xFFFFFF : aaci);
451
+ const ret = wasm.analyzer_analyze_anti_air(this.ptr, comp.ptr, addHeapObject(formation), ship_anti_air_resist, fleet_anti_air_resist, isLikeNone(aaci) ? 0xFFFFFF : aaci);
500
452
  return takeObject(ret);
501
453
  }
502
454
  /**
@@ -775,12 +727,12 @@ export class Comp {
775
727
  return takeObject(ret);
776
728
  }
777
729
  /**
778
- * 艦隊対空値
730
+ * 艦隊防空値
779
731
  * @param {number} formation_mod
780
732
  * @returns {number}
781
733
  */
782
- fleet_anti_air(formation_mod) {
783
- const ret = wasm.comp_fleet_anti_air(this.ptr, formation_mod);
734
+ adjusted_anti_air(formation_mod) {
735
+ const ret = wasm.comp_adjusted_anti_air(this.ptr, formation_mod);
784
736
  return ret;
785
737
  }
786
738
  /**
@@ -860,7 +812,7 @@ export class FhCore {
860
812
  wasm.__wbg_fhcore_free(ptr);
861
813
  }
862
814
  /**
863
- * @param {any} js_master
815
+ * @param {MasterData} js_master
864
816
  * @param {Function} js_fn
865
817
  */
866
818
  constructor(js_master, js_fn) {
@@ -1419,6 +1371,29 @@ export class Gear {
1419
1371
  }
1420
1372
  /**
1421
1373
  */
1374
+ get types() {
1375
+ try {
1376
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1377
+ wasm.__wbg_get_gear_types(retptr, this.ptr);
1378
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1379
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1380
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
1381
+ wasm.__wbindgen_free(r0, r1 * 1);
1382
+ return v0;
1383
+ } finally {
1384
+ wasm.__wbindgen_add_to_stack_pointer(16);
1385
+ }
1386
+ }
1387
+ /**
1388
+ * @param {Uint8Array} arg0
1389
+ */
1390
+ set types(arg0) {
1391
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1392
+ const len0 = WASM_VECTOR_LEN;
1393
+ wasm.__wbg_set_gear_types(this.ptr, ptr0, len0);
1394
+ }
1395
+ /**
1396
+ */
1422
1397
  get gear_type() {
1423
1398
  const ret = wasm.__wbg_get_gear_gear_type(this.ptr);
1424
1399
  return takeObject(ret);
@@ -1623,15 +1598,15 @@ export class Gear {
1623
1598
  }
1624
1599
  /**
1625
1600
  */
1626
- get adjusted_anti_air_resistance() {
1627
- const ret = wasm.__wbg_get_gear_adjusted_anti_air_resistance(this.ptr);
1601
+ get ship_anti_air_resistance() {
1602
+ const ret = wasm.__wbg_get_gear_ship_anti_air_resistance(this.ptr);
1628
1603
  return ret;
1629
1604
  }
1630
1605
  /**
1631
1606
  * @param {number} arg0
1632
1607
  */
1633
- set adjusted_anti_air_resistance(arg0) {
1634
- wasm.__wbg_set_gear_adjusted_anti_air_resistance(this.ptr, arg0);
1608
+ set ship_anti_air_resistance(arg0) {
1609
+ wasm.__wbg_set_gear_ship_anti_air_resistance(this.ptr, arg0);
1635
1610
  }
1636
1611
  /**
1637
1612
  */
@@ -1653,13 +1628,6 @@ export class Gear {
1653
1628
  return Gear.__wrap(ret);
1654
1629
  }
1655
1630
  /**
1656
- * @returns {any}
1657
- */
1658
- get types() {
1659
- const ret = wasm.gear_types(this.ptr);
1660
- return takeObject(ret);
1661
- }
1662
- /**
1663
1631
  * @returns {number}
1664
1632
  */
1665
1633
  get gear_type_id() {
@@ -1727,7 +1695,7 @@ export class Gear {
1727
1695
  * @returns {boolean}
1728
1696
  */
1729
1697
  has_proficiency() {
1730
- const ret = wasm.gear_has_proficiency(this.ptr);
1698
+ const ret = wasm.gear_can_be_deployed_to_land_base(this.ptr);
1731
1699
  return ret !== 0;
1732
1700
  }
1733
1701
  /**
@@ -1763,15 +1731,15 @@ export class Gear {
1763
1731
  /**
1764
1732
  * @returns {number}
1765
1733
  */
1766
- fleet_anti_air() {
1767
- const ret = wasm.gear_fleet_anti_air(this.ptr);
1734
+ fleet_anti_air_mod() {
1735
+ const ret = wasm.gear_fleet_anti_air_mod(this.ptr);
1768
1736
  return ret;
1769
1737
  }
1770
1738
  /**
1771
1739
  * @returns {number}
1772
1740
  */
1773
- adjusted_anti_air() {
1774
- const ret = wasm.gear_adjusted_anti_air(this.ptr);
1741
+ ship_anti_air_mod() {
1742
+ const ret = wasm.gear_ship_anti_air_mod(this.ptr);
1775
1743
  return ret;
1776
1744
  }
1777
1745
  /**
@@ -1849,6 +1817,13 @@ export class Gear {
1849
1817
  const ret = wasm.gear_expedition_bonus(this.ptr);
1850
1818
  return ret;
1851
1819
  }
1820
+ /**
1821
+ * @returns {boolean}
1822
+ */
1823
+ can_be_deployed_to_land_base() {
1824
+ const ret = wasm.gear_can_be_deployed_to_land_base(this.ptr);
1825
+ return ret !== 0;
1826
+ }
1852
1827
  }
1853
1828
 
1854
1829
  const IBonusesFinalization = new FinalizationRegistry(ptr => wasm.__wbg_ibonuses_free(ptr));
@@ -2025,15 +2000,15 @@ export class IBonuses {
2025
2000
  }
2026
2001
  /**
2027
2002
  */
2028
- get adjusted_anti_air() {
2029
- const ret = wasm.__wbg_get_ibonuses_adjusted_anti_air(this.ptr);
2003
+ get ship_anti_air() {
2004
+ const ret = wasm.__wbg_get_ibonuses_ship_anti_air(this.ptr);
2030
2005
  return ret;
2031
2006
  }
2032
2007
  /**
2033
2008
  * @param {number} arg0
2034
2009
  */
2035
- set adjusted_anti_air(arg0) {
2036
- wasm.__wbg_set_ibonuses_adjusted_anti_air(this.ptr, arg0);
2010
+ set ship_anti_air(arg0) {
2011
+ wasm.__wbg_set_ibonuses_ship_anti_air(this.ptr, arg0);
2037
2012
  }
2038
2013
  /**
2039
2014
  */
@@ -2677,6 +2652,18 @@ export class Ship {
2677
2652
  wasm.__wbg_set_ship_ctype(this.ptr, arg0);
2678
2653
  }
2679
2654
  /**
2655
+ */
2656
+ get slots() {
2657
+ const ret = wasm.__wbg_get_ship_slots(this.ptr);
2658
+ return takeObject(ret);
2659
+ }
2660
+ /**
2661
+ * @param {SlotSizeVec} arg0
2662
+ */
2663
+ set slots(arg0) {
2664
+ wasm.__wbg_set_ship_slots(this.ptr, addHeapObject(arg0));
2665
+ }
2666
+ /**
2680
2667
  * @returns {number | undefined}
2681
2668
  */
2682
2669
  get naked_firepower() {
@@ -3177,8 +3164,8 @@ export class Ship {
3177
3164
  /**
3178
3165
  * @returns {number}
3179
3166
  */
3180
- fleet_anti_air() {
3181
- const ret = wasm.ship_fleet_anti_air(this.ptr);
3167
+ fleet_anti_air_mod() {
3168
+ const ret = wasm.ship_fleet_anti_air_mod(this.ptr);
3182
3169
  return ret;
3183
3170
  }
3184
3171
  /**
@@ -3286,11 +3273,6 @@ export class Ship {
3286
3273
  }
3287
3274
  }
3288
3275
 
3289
- export function __wbindgen_string_new(arg0, arg1) {
3290
- const ret = getStringFromWasm0(arg0, arg1);
3291
- return addHeapObject(ret);
3292
- };
3293
-
3294
3276
  export function __wbindgen_object_drop_ref(arg0) {
3295
3277
  takeObject(arg0);
3296
3278
  };
@@ -3304,13 +3286,14 @@ export function __wbindgen_json_serialize(arg0, arg1) {
3304
3286
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3305
3287
  };
3306
3288
 
3307
- export function __wbindgen_json_parse(arg0, arg1) {
3308
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3289
+ export function __wbindgen_string_new(arg0, arg1) {
3290
+ const ret = getStringFromWasm0(arg0, arg1);
3309
3291
  return addHeapObject(ret);
3310
3292
  };
3311
3293
 
3312
- export function __wbg_error_8ff19d586a987aef(arg0) {
3313
- console.error(getObject(arg0));
3294
+ export function __wbindgen_json_parse(arg0, arg1) {
3295
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3296
+ return addHeapObject(ret);
3314
3297
  };
3315
3298
 
3316
3299
  export function __wbg_new_693216e109162396() {
Binary file