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,41 +1,16 @@
1
1
  let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
- const { TextDecoder, TextEncoder } = require(`util`);
5
-
6
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
7
-
8
- cachedTextDecoder.decode();
9
-
10
- let cachegetUint8Memory0 = null;
11
- function getUint8Memory0() {
12
- if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
13
- cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
14
- }
15
- return cachegetUint8Memory0;
16
- }
17
-
18
- function getStringFromWasm0(ptr, len) {
19
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
20
- }
4
+ const { TextEncoder, TextDecoder } = require(`util`);
21
5
 
22
6
  const heap = new Array(32).fill(undefined);
23
7
 
24
8
  heap.push(undefined, null, true, false);
25
9
 
26
- let heap_next = heap.length;
27
-
28
- function addHeapObject(obj) {
29
- if (heap_next === heap.length) heap.push(heap.length + 1);
30
- const idx = heap_next;
31
- heap_next = heap[idx];
32
-
33
- heap[idx] = obj;
34
- return idx;
35
- }
36
-
37
10
  function getObject(idx) { return heap[idx]; }
38
11
 
12
+ let heap_next = heap.length;
13
+
39
14
  function dropObject(idx) {
40
15
  if (idx < 36) return;
41
16
  heap[idx] = heap_next;
@@ -50,6 +25,14 @@ function takeObject(idx) {
50
25
 
51
26
  let WASM_VECTOR_LEN = 0;
52
27
 
28
+ let cachegetUint8Memory0 = null;
29
+ function getUint8Memory0() {
30
+ if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
31
+ cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
32
+ }
33
+ return cachegetUint8Memory0;
34
+ }
35
+
53
36
  let cachedTextEncoder = new TextEncoder('utf-8');
54
37
 
55
38
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -111,6 +94,23 @@ function getInt32Memory0() {
111
94
  return cachegetInt32Memory0;
112
95
  }
113
96
 
97
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
98
+
99
+ cachedTextDecoder.decode();
100
+
101
+ function getStringFromWasm0(ptr, len) {
102
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
103
+ }
104
+
105
+ function addHeapObject(obj) {
106
+ if (heap_next === heap.length) heap.push(heap.length + 1);
107
+ const idx = heap_next;
108
+ heap_next = heap[idx];
109
+
110
+ heap[idx] = obj;
111
+ return idx;
112
+ }
113
+
114
114
  function debugString(val) {
115
115
  // primitive types
116
116
  const type = typeof val;
@@ -180,6 +180,21 @@ const u32CvtShim = new Uint32Array(2);
180
180
 
181
181
  const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
182
182
 
183
+ function _assertClass(instance, klass) {
184
+ if (!(instance instanceof klass)) {
185
+ throw new Error(`expected instance of ${klass.name}`);
186
+ }
187
+ return instance.ptr;
188
+ }
189
+
190
+ let cachegetFloat64Memory0 = null;
191
+ function getFloat64Memory0() {
192
+ if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
193
+ cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
194
+ }
195
+ return cachegetFloat64Memory0;
196
+ }
197
+
183
198
  function isLikeNone(x) {
184
199
  return x === undefined || x === null;
185
200
  }
@@ -202,14 +217,6 @@ function getArrayJsValueFromWasm0(ptr, len) {
202
217
  return result;
203
218
  }
204
219
 
205
- let cachegetFloat64Memory0 = null;
206
- function getFloat64Memory0() {
207
- if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
208
- cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
209
- }
210
- return cachegetFloat64Memory0;
211
- }
212
-
213
220
  let cachegetUint16Memory0 = null;
214
221
  function getUint16Memory0() {
215
222
  if (cachegetUint16Memory0 === null || cachegetUint16Memory0.buffer !== wasm.memory.buffer) {
@@ -221,65 +228,12 @@ function getUint16Memory0() {
221
228
  function getArrayU16FromWasm0(ptr, len) {
222
229
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
223
230
  }
224
-
225
- function _assertClass(instance, klass) {
226
- if (!(instance instanceof klass)) {
227
- throw new Error(`expected instance of ${klass.name}`);
228
- }
229
- return instance.ptr;
230
- }
231
- /**
232
- * @param {Gear} gear
233
- * @returns {boolean}
234
- */
235
- module.exports.air_squadron_can_equip = function(gear) {
236
- _assertClass(gear, Gear);
237
- const ret = wasm.air_squadron_can_equip(gear.ptr);
238
- return ret !== 0;
239
- };
240
-
241
231
  /**
242
232
  */
243
233
  module.exports.set_panic_hook = function() {
244
234
  wasm.set_panic_hook();
245
235
  };
246
236
 
247
- /**
248
- * @param {OrgType} org_type
249
- * @returns {boolean}
250
- */
251
- module.exports.org_type_is_single = function(org_type) {
252
- const ret = wasm.org_type_is_single(addHeapObject(org_type));
253
- return ret !== 0;
254
- };
255
-
256
- /**
257
- * @param {OrgType} org_type
258
- * @returns {Formation}
259
- */
260
- module.exports.org_type_default_formation = function(org_type) {
261
- const ret = wasm.org_type_default_formation(addHeapObject(org_type));
262
- return takeObject(ret);
263
- };
264
-
265
- /**
266
- * @param {OrgType} org_type
267
- * @returns {boolean}
268
- */
269
- module.exports.org_type_is_player = function(org_type) {
270
- const ret = wasm.org_type_is_player(addHeapObject(org_type));
271
- return ret !== 0;
272
- };
273
-
274
- /**
275
- * @param {OrgType} org_type
276
- * @returns {Side}
277
- */
278
- module.exports.org_type_side = function(org_type) {
279
- const ret = wasm.org_type_side(addHeapObject(org_type));
280
- return takeObject(ret);
281
- };
282
-
283
237
  function passArray16ToWasm0(arg, malloc) {
284
238
  const ptr = malloc(arg.length * 2);
285
239
  getUint16Memory0().set(arg, ptr / 2);
@@ -287,6 +241,17 @@ function passArray16ToWasm0(arg, malloc) {
287
241
  return ptr;
288
242
  }
289
243
 
244
+ function getArrayU8FromWasm0(ptr, len) {
245
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
246
+ }
247
+
248
+ function passArray8ToWasm0(arg, malloc) {
249
+ const ptr = malloc(arg.length * 1);
250
+ getUint8Memory0().set(arg, ptr / 1);
251
+ WASM_VECTOR_LEN = arg.length;
252
+ return ptr;
253
+ }
254
+
290
255
  function handleError(f, args) {
291
256
  try {
292
257
  return f.apply(this, args);
@@ -295,10 +260,6 @@ function handleError(f, args) {
295
260
  }
296
261
  }
297
262
 
298
- function getArrayU8FromWasm0(ptr, len) {
299
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
300
- }
301
-
302
263
  const AirSquadronFinalization = new FinalizationRegistry(ptr => wasm.__wbg_airsquadron_free(ptr));
303
264
  /**
304
265
  */
@@ -392,15 +353,6 @@ class AirSquadron {
392
353
  return ret === 0 ? undefined : Gear.__wrap(ret);
393
354
  }
394
355
  /**
395
- * @param {Gear} gear
396
- * @returns {boolean}
397
- */
398
- can_equip(gear) {
399
- _assertClass(gear, Gear);
400
- const ret = wasm.airsquadron_can_equip(this.ptr, gear.ptr);
401
- return ret !== 0;
402
- }
403
- /**
404
356
  * @param {number} index
405
357
  * @returns {number}
406
358
  */
@@ -489,14 +441,14 @@ 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
  /**
@@ -776,12 +728,12 @@ class Comp {
776
728
  return takeObject(ret);
777
729
  }
778
730
  /**
779
- * 艦隊対空値
731
+ * 艦隊防空値
780
732
  * @param {number} formation_mod
781
733
  * @returns {number}
782
734
  */
783
- fleet_anti_air(formation_mod) {
784
- const ret = wasm.comp_fleet_anti_air(this.ptr, formation_mod);
735
+ adjusted_anti_air(formation_mod) {
736
+ const ret = wasm.comp_adjusted_anti_air(this.ptr, formation_mod);
785
737
  return ret;
786
738
  }
787
739
  /**
@@ -862,7 +814,7 @@ class FhCore {
862
814
  wasm.__wbg_fhcore_free(ptr);
863
815
  }
864
816
  /**
865
- * @param {any} js_master
817
+ * @param {MasterData} js_master
866
818
  * @param {Function} js_fn
867
819
  */
868
820
  constructor(js_master, js_fn) {
@@ -1423,6 +1375,29 @@ class Gear {
1423
1375
  }
1424
1376
  /**
1425
1377
  */
1378
+ get types() {
1379
+ try {
1380
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1381
+ wasm.__wbg_get_gear_types(retptr, this.ptr);
1382
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1383
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1384
+ var v0 = getArrayU8FromWasm0(r0, r1).slice();
1385
+ wasm.__wbindgen_free(r0, r1 * 1);
1386
+ return v0;
1387
+ } finally {
1388
+ wasm.__wbindgen_add_to_stack_pointer(16);
1389
+ }
1390
+ }
1391
+ /**
1392
+ * @param {Uint8Array} arg0
1393
+ */
1394
+ set types(arg0) {
1395
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
1396
+ const len0 = WASM_VECTOR_LEN;
1397
+ wasm.__wbg_set_gear_types(this.ptr, ptr0, len0);
1398
+ }
1399
+ /**
1400
+ */
1426
1401
  get gear_type() {
1427
1402
  const ret = wasm.__wbg_get_gear_gear_type(this.ptr);
1428
1403
  return takeObject(ret);
@@ -1627,15 +1602,15 @@ class Gear {
1627
1602
  }
1628
1603
  /**
1629
1604
  */
1630
- get adjusted_anti_air_resistance() {
1631
- const ret = wasm.__wbg_get_gear_adjusted_anti_air_resistance(this.ptr);
1605
+ get ship_anti_air_resistance() {
1606
+ const ret = wasm.__wbg_get_gear_ship_anti_air_resistance(this.ptr);
1632
1607
  return ret;
1633
1608
  }
1634
1609
  /**
1635
1610
  * @param {number} arg0
1636
1611
  */
1637
- set adjusted_anti_air_resistance(arg0) {
1638
- wasm.__wbg_set_gear_adjusted_anti_air_resistance(this.ptr, arg0);
1612
+ set ship_anti_air_resistance(arg0) {
1613
+ wasm.__wbg_set_gear_ship_anti_air_resistance(this.ptr, arg0);
1639
1614
  }
1640
1615
  /**
1641
1616
  */
@@ -1657,13 +1632,6 @@ class Gear {
1657
1632
  return Gear.__wrap(ret);
1658
1633
  }
1659
1634
  /**
1660
- * @returns {any}
1661
- */
1662
- get types() {
1663
- const ret = wasm.gear_types(this.ptr);
1664
- return takeObject(ret);
1665
- }
1666
- /**
1667
1635
  * @returns {number}
1668
1636
  */
1669
1637
  get gear_type_id() {
@@ -1731,7 +1699,7 @@ class Gear {
1731
1699
  * @returns {boolean}
1732
1700
  */
1733
1701
  has_proficiency() {
1734
- const ret = wasm.gear_has_proficiency(this.ptr);
1702
+ const ret = wasm.gear_can_be_deployed_to_land_base(this.ptr);
1735
1703
  return ret !== 0;
1736
1704
  }
1737
1705
  /**
@@ -1767,15 +1735,15 @@ class Gear {
1767
1735
  /**
1768
1736
  * @returns {number}
1769
1737
  */
1770
- fleet_anti_air() {
1771
- const ret = wasm.gear_fleet_anti_air(this.ptr);
1738
+ fleet_anti_air_mod() {
1739
+ const ret = wasm.gear_fleet_anti_air_mod(this.ptr);
1772
1740
  return ret;
1773
1741
  }
1774
1742
  /**
1775
1743
  * @returns {number}
1776
1744
  */
1777
- adjusted_anti_air() {
1778
- const ret = wasm.gear_adjusted_anti_air(this.ptr);
1745
+ ship_anti_air_mod() {
1746
+ const ret = wasm.gear_ship_anti_air_mod(this.ptr);
1779
1747
  return ret;
1780
1748
  }
1781
1749
  /**
@@ -1853,6 +1821,13 @@ class Gear {
1853
1821
  const ret = wasm.gear_expedition_bonus(this.ptr);
1854
1822
  return ret;
1855
1823
  }
1824
+ /**
1825
+ * @returns {boolean}
1826
+ */
1827
+ can_be_deployed_to_land_base() {
1828
+ const ret = wasm.gear_can_be_deployed_to_land_base(this.ptr);
1829
+ return ret !== 0;
1830
+ }
1856
1831
  }
1857
1832
  module.exports.Gear = Gear;
1858
1833
 
@@ -2030,15 +2005,15 @@ class IBonuses {
2030
2005
  }
2031
2006
  /**
2032
2007
  */
2033
- get adjusted_anti_air() {
2034
- const ret = wasm.__wbg_get_ibonuses_adjusted_anti_air(this.ptr);
2008
+ get ship_anti_air() {
2009
+ const ret = wasm.__wbg_get_ibonuses_ship_anti_air(this.ptr);
2035
2010
  return ret;
2036
2011
  }
2037
2012
  /**
2038
2013
  * @param {number} arg0
2039
2014
  */
2040
- set adjusted_anti_air(arg0) {
2041
- wasm.__wbg_set_ibonuses_adjusted_anti_air(this.ptr, arg0);
2015
+ set ship_anti_air(arg0) {
2016
+ wasm.__wbg_set_ibonuses_ship_anti_air(this.ptr, arg0);
2042
2017
  }
2043
2018
  /**
2044
2019
  */
@@ -2684,6 +2659,18 @@ class Ship {
2684
2659
  wasm.__wbg_set_ship_ctype(this.ptr, arg0);
2685
2660
  }
2686
2661
  /**
2662
+ */
2663
+ get slots() {
2664
+ const ret = wasm.__wbg_get_ship_slots(this.ptr);
2665
+ return takeObject(ret);
2666
+ }
2667
+ /**
2668
+ * @param {SlotSizeVec} arg0
2669
+ */
2670
+ set slots(arg0) {
2671
+ wasm.__wbg_set_ship_slots(this.ptr, addHeapObject(arg0));
2672
+ }
2673
+ /**
2687
2674
  * @returns {number | undefined}
2688
2675
  */
2689
2676
  get naked_firepower() {
@@ -3184,8 +3171,8 @@ class Ship {
3184
3171
  /**
3185
3172
  * @returns {number}
3186
3173
  */
3187
- fleet_anti_air() {
3188
- const ret = wasm.ship_fleet_anti_air(this.ptr);
3174
+ fleet_anti_air_mod() {
3175
+ const ret = wasm.ship_fleet_anti_air_mod(this.ptr);
3189
3176
  return ret;
3190
3177
  }
3191
3178
  /**
@@ -3294,11 +3281,6 @@ class Ship {
3294
3281
  }
3295
3282
  module.exports.Ship = Ship;
3296
3283
 
3297
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
3298
- const ret = getStringFromWasm0(arg0, arg1);
3299
- return addHeapObject(ret);
3300
- };
3301
-
3302
3284
  module.exports.__wbindgen_object_drop_ref = function(arg0) {
3303
3285
  takeObject(arg0);
3304
3286
  };
@@ -3312,13 +3294,14 @@ module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
3312
3294
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3313
3295
  };
3314
3296
 
3315
- module.exports.__wbindgen_json_parse = function(arg0, arg1) {
3316
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3297
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
3298
+ const ret = getStringFromWasm0(arg0, arg1);
3317
3299
  return addHeapObject(ret);
3318
3300
  };
3319
3301
 
3320
- module.exports.__wbg_error_8ff19d586a987aef = function(arg0) {
3321
- console.error(getObject(arg0));
3302
+ module.exports.__wbindgen_json_parse = function(arg0, arg1) {
3303
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3304
+ return addHeapObject(ret);
3322
3305
  };
3323
3306
 
3324
3307
  module.exports.__wbg_new_693216e109162396 = function() {
Binary file