fleethub-core 0.5.2 → 0.8.1

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.
@@ -175,11 +175,10 @@ function debugString(val) {
175
175
  // TODO we could test for more things here, like `Set`s and `Map`s.
176
176
  return className;
177
177
  }
178
- /**
179
- */
180
- module.exports.set_panic_hook = function() {
181
- wasm.set_panic_hook();
182
- };
178
+
179
+ const u32CvtShim = new Uint32Array(2);
180
+
181
+ const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
183
182
 
184
183
  function _assertClass(instance, klass) {
185
184
  if (!(instance instanceof klass)) {
@@ -187,6 +186,18 @@ function _assertClass(instance, klass) {
187
186
  }
188
187
  return instance.ptr;
189
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
+
198
+ function getArrayU8FromWasm0(ptr, len) {
199
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
200
+ }
190
201
  /**
191
202
  * @param {Gear} gear
192
203
  * @returns {boolean}
@@ -201,14 +212,6 @@ function isLikeNone(x) {
201
212
  return x === undefined || x === null;
202
213
  }
203
214
 
204
- let cachegetFloat64Memory0 = null;
205
- function getFloat64Memory0() {
206
- if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
207
- cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
208
- }
209
- return cachegetFloat64Memory0;
210
- }
211
-
212
215
  let cachegetUint32Memory0 = null;
213
216
  function getUint32Memory0() {
214
217
  if (cachegetUint32Memory0 === null || cachegetUint32Memory0.buffer !== wasm.memory.buffer) {
@@ -226,6 +229,11 @@ function getArrayJsValueFromWasm0(ptr, len) {
226
229
  }
227
230
  return result;
228
231
  }
232
+ /**
233
+ */
234
+ module.exports.set_panic_hook = function() {
235
+ wasm.set_panic_hook();
236
+ };
229
237
 
230
238
  let cachegetUint16Memory0 = null;
231
239
  function getUint16Memory0() {
@@ -277,10 +285,6 @@ module.exports.org_type_side = function(org_type) {
277
285
  return takeObject(ret);
278
286
  };
279
287
 
280
- function getArrayU8FromWasm0(ptr, len) {
281
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
282
- }
283
-
284
288
  function getArrayU16FromWasm0(ptr, len) {
285
289
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
286
290
  }
@@ -340,6 +344,31 @@ class AirSquadron {
340
344
  }
341
345
  /**
342
346
  */
347
+ get xxh3() {
348
+ try {
349
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
350
+ wasm.__wbg_get_airsquadron_xxh3(retptr, this.ptr);
351
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
352
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
353
+ u32CvtShim[0] = r0;
354
+ u32CvtShim[1] = r1;
355
+ const n0 = uint64CvtShim[0];
356
+ return n0;
357
+ } finally {
358
+ wasm.__wbindgen_add_to_stack_pointer(16);
359
+ }
360
+ }
361
+ /**
362
+ * @param {BigInt} arg0
363
+ */
364
+ set xxh3(arg0) {
365
+ uint64CvtShim[0] = arg0;
366
+ const low0 = u32CvtShim[0];
367
+ const high0 = u32CvtShim[1];
368
+ wasm.__wbg_set_airsquadron_xxh3(this.ptr, low0, high0);
369
+ }
370
+ /**
371
+ */
343
372
  get mode() {
344
373
  var ret = wasm.__wbg_get_airsquadron_mode(this.ptr);
345
374
  return takeObject(ret);
@@ -351,21 +380,6 @@ class AirSquadron {
351
380
  wasm.__wbg_set_airsquadron_mode(this.ptr, addHeapObject(arg0));
352
381
  }
353
382
  /**
354
- * @returns {string}
355
- */
356
- get xxh3() {
357
- try {
358
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
359
- wasm.airsquadron_xxh3(retptr, this.ptr);
360
- var r0 = getInt32Memory0()[retptr / 4 + 0];
361
- var r1 = getInt32Memory0()[retptr / 4 + 1];
362
- return getStringFromWasm0(r0, r1);
363
- } finally {
364
- wasm.__wbindgen_add_to_stack_pointer(16);
365
- wasm.__wbindgen_free(r0, r1);
366
- }
367
- }
368
- /**
369
383
  * @param {string} key
370
384
  * @returns {Gear | undefined}
371
385
  */
@@ -389,16 +403,38 @@ class AirSquadron {
389
403
  * @returns {number}
390
404
  */
391
405
  get_slot_size(index) {
392
- var ret = wasm.airsquadron_get_slot_size(this.ptr, index);
393
- return ret;
406
+ try {
407
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
408
+ wasm.airsquadron_get_slot_size(retptr, this.ptr, index);
409
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
410
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
411
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
412
+ if (r2) {
413
+ throw takeObject(r1);
414
+ }
415
+ return r0;
416
+ } finally {
417
+ wasm.__wbindgen_add_to_stack_pointer(16);
418
+ }
394
419
  }
395
420
  /**
396
421
  * @param {number} index
397
422
  * @returns {number}
398
423
  */
399
424
  get_max_slot_size(index) {
400
- var ret = wasm.airsquadron_get_max_slot_size(this.ptr, index);
401
- return ret;
425
+ try {
426
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
427
+ wasm.airsquadron_get_max_slot_size(retptr, this.ptr, index);
428
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
429
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
430
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
431
+ if (r2) {
432
+ throw takeObject(r1);
433
+ }
434
+ return r0;
435
+ } finally {
436
+ wasm.__wbindgen_add_to_stack_pointer(16);
437
+ }
402
438
  }
403
439
  /**
404
440
  * @returns {number}
@@ -766,8 +802,8 @@ class Comp {
766
802
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
767
803
  wasm.comp_elos(retptr, this.ptr, node_divaricated_factor);
768
804
  var r0 = getInt32Memory0()[retptr / 4 + 0];
769
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
770
- return r0 === 0 ? undefined : r1;
805
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
806
+ return r0 === 0 ? undefined : r2;
771
807
  } finally {
772
808
  wasm.__wbindgen_add_to_stack_pointer(16);
773
809
  }
@@ -811,8 +847,19 @@ class FhCore {
811
847
  * @param {Function} js_fn
812
848
  */
813
849
  constructor(js_master, js_fn) {
814
- var ret = wasm.fhcore_new(addHeapObject(js_master), addHeapObject(js_fn));
815
- return FhCore.__wrap(ret);
850
+ try {
851
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
852
+ wasm.fhcore_new(retptr, addHeapObject(js_master), addHeapObject(js_fn));
853
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
854
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
855
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
856
+ if (r2) {
857
+ throw takeObject(r1);
858
+ }
859
+ return FhCore.__wrap(r0);
860
+ } finally {
861
+ wasm.__wbindgen_add_to_stack_pointer(16);
862
+ }
816
863
  }
817
864
  /**
818
865
  * @param {bindings.GearState | undefined} input
@@ -897,10 +944,21 @@ class FhCore {
897
944
  * @returns {bindings.SimulatorResult}
898
945
  */
899
946
  simulate_shelling_support(player, enemy, params, times) {
900
- _assertClass(player, Comp);
901
- _assertClass(enemy, Comp);
902
- var ret = wasm.fhcore_simulate_shelling_support(this.ptr, player.ptr, enemy.ptr, addHeapObject(params), times);
903
- return takeObject(ret);
947
+ try {
948
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
949
+ _assertClass(player, Comp);
950
+ _assertClass(enemy, Comp);
951
+ wasm.fhcore_simulate_shelling_support(retptr, this.ptr, player.ptr, enemy.ptr, addHeapObject(params), times);
952
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
953
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
954
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
955
+ if (r2) {
956
+ throw takeObject(r1);
957
+ }
958
+ return takeObject(r0);
959
+ } finally {
960
+ wasm.__wbindgen_add_to_stack_pointer(16);
961
+ }
904
962
  }
905
963
  }
906
964
  module.exports.FhCore = FhCore;
@@ -952,6 +1010,31 @@ class Fleet {
952
1010
  }
953
1011
  /**
954
1012
  */
1013
+ get xxh3() {
1014
+ try {
1015
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1016
+ wasm.__wbg_get_fleet_xxh3(retptr, this.ptr);
1017
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1018
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1019
+ u32CvtShim[0] = r0;
1020
+ u32CvtShim[1] = r1;
1021
+ const n0 = uint64CvtShim[0];
1022
+ return n0;
1023
+ } finally {
1024
+ wasm.__wbindgen_add_to_stack_pointer(16);
1025
+ }
1026
+ }
1027
+ /**
1028
+ * @param {BigInt} arg0
1029
+ */
1030
+ set xxh3(arg0) {
1031
+ uint64CvtShim[0] = arg0;
1032
+ const low0 = u32CvtShim[0];
1033
+ const high0 = u32CvtShim[1];
1034
+ wasm.__wbg_set_fleet_xxh3(this.ptr, low0, high0);
1035
+ }
1036
+ /**
1037
+ */
955
1038
  get len() {
956
1039
  var ret = wasm.__wbg_get_fleet_len(this.ptr);
957
1040
  return ret >>> 0;
@@ -963,21 +1046,6 @@ class Fleet {
963
1046
  wasm.__wbg_set_fleet_len(this.ptr, arg0);
964
1047
  }
965
1048
  /**
966
- * @returns {string}
967
- */
968
- get xxh3() {
969
- try {
970
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
971
- wasm.fleet_xxh3(retptr, this.ptr);
972
- var r0 = getInt32Memory0()[retptr / 4 + 0];
973
- var r1 = getInt32Memory0()[retptr / 4 + 1];
974
- return getStringFromWasm0(r0, r1);
975
- } finally {
976
- wasm.__wbindgen_add_to_stack_pointer(16);
977
- wasm.__wbindgen_free(r0, r1);
978
- }
979
- }
980
- /**
981
1049
  * @returns {bindings.FleetMeta}
982
1050
  */
983
1051
  meta() {
@@ -1108,8 +1176,8 @@ class Fleet {
1108
1176
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1109
1177
  wasm.fleet_fleet_los_mod(retptr, this.ptr);
1110
1178
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1111
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
1112
- return r0 === 0 ? undefined : r1;
1179
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
1180
+ return r0 === 0 ? undefined : r2;
1113
1181
  } finally {
1114
1182
  wasm.__wbindgen_add_to_stack_pointer(16);
1115
1183
  }
@@ -1140,8 +1208,8 @@ class Fleet {
1140
1208
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1141
1209
  wasm.fleet_elos(retptr, this.ptr, hq_level, node_divaricated_factor);
1142
1210
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1143
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
1144
- return r0 === 0 ? undefined : r1;
1211
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
1212
+ return r0 === 0 ? undefined : r2;
1145
1213
  } finally {
1146
1214
  wasm.__wbindgen_add_to_stack_pointer(16);
1147
1215
  }
@@ -1155,8 +1223,8 @@ class Fleet {
1155
1223
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1156
1224
  wasm.fleet_aviation_detection_score(retptr, this.ptr);
1157
1225
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1158
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
1159
- return r0 === 0 ? undefined : r1;
1226
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
1227
+ return r0 === 0 ? undefined : r2;
1160
1228
  } finally {
1161
1229
  wasm.__wbindgen_add_to_stack_pointer(16);
1162
1230
  }
@@ -1180,8 +1248,8 @@ class Fleet {
1180
1248
  var len0 = WASM_VECTOR_LEN;
1181
1249
  wasm.fleet_sum_ship_stat_by(retptr, this.ptr, ptr0, len0);
1182
1250
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1183
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
1184
- return r0 === 0 ? undefined : r1;
1251
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
1252
+ return r0 === 0 ? undefined : r2;
1185
1253
  } finally {
1186
1254
  wasm.__wbindgen_add_to_stack_pointer(16);
1187
1255
  }
@@ -1241,6 +1309,31 @@ class Gear {
1241
1309
  }
1242
1310
  /**
1243
1311
  */
1312
+ get xxh3() {
1313
+ try {
1314
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1315
+ wasm.__wbg_get_gear_xxh3(retptr, this.ptr);
1316
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1317
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1318
+ u32CvtShim[0] = r0;
1319
+ u32CvtShim[1] = r1;
1320
+ const n0 = uint64CvtShim[0];
1321
+ return n0;
1322
+ } finally {
1323
+ wasm.__wbindgen_add_to_stack_pointer(16);
1324
+ }
1325
+ }
1326
+ /**
1327
+ * @param {BigInt} arg0
1328
+ */
1329
+ set xxh3(arg0) {
1330
+ uint64CvtShim[0] = arg0;
1331
+ const low0 = u32CvtShim[0];
1332
+ const high0 = u32CvtShim[1];
1333
+ wasm.__wbg_set_gear_xxh3(this.ptr, low0, high0);
1334
+ }
1335
+ /**
1336
+ */
1244
1337
  get gear_id() {
1245
1338
  var ret = wasm.__wbg_get_gear_gear_id(this.ptr);
1246
1339
  return ret;
@@ -1545,21 +1638,6 @@ class Gear {
1545
1638
  return Gear.__wrap(ret);
1546
1639
  }
1547
1640
  /**
1548
- * @returns {string}
1549
- */
1550
- get xxh3() {
1551
- try {
1552
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1553
- wasm.gear_xxh3(retptr, this.ptr);
1554
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1555
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1556
- return getStringFromWasm0(r0, r1);
1557
- } finally {
1558
- wasm.__wbindgen_add_to_stack_pointer(16);
1559
- wasm.__wbindgen_free(r0, r1);
1560
- }
1561
- }
1562
- /**
1563
1641
  * @returns {any}
1564
1642
  */
1565
1643
  get types() {
@@ -1738,6 +1816,13 @@ class Gear {
1738
1816
  /**
1739
1817
  * @returns {boolean}
1740
1818
  */
1819
+ is_abyssal() {
1820
+ var ret = wasm.gear_is_abyssal(this.ptr);
1821
+ return ret !== 0;
1822
+ }
1823
+ /**
1824
+ * @returns {boolean}
1825
+ */
1741
1826
  is_abyssal_cuttlefish_torpedo() {
1742
1827
  var ret = wasm.gear_is_abyssal_cuttlefish_torpedo(this.ptr);
1743
1828
  return ret !== 0;
@@ -2017,6 +2102,31 @@ class Org {
2017
2102
  }
2018
2103
  /**
2019
2104
  */
2105
+ get xxh3() {
2106
+ try {
2107
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2108
+ wasm.__wbg_get_org_xxh3(retptr, this.ptr);
2109
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2110
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2111
+ u32CvtShim[0] = r0;
2112
+ u32CvtShim[1] = r1;
2113
+ const n0 = uint64CvtShim[0];
2114
+ return n0;
2115
+ } finally {
2116
+ wasm.__wbindgen_add_to_stack_pointer(16);
2117
+ }
2118
+ }
2119
+ /**
2120
+ * @param {BigInt} arg0
2121
+ */
2122
+ set xxh3(arg0) {
2123
+ uint64CvtShim[0] = arg0;
2124
+ const low0 = u32CvtShim[0];
2125
+ const high0 = u32CvtShim[1];
2126
+ wasm.__wbg_set_org_xxh3(this.ptr, low0, high0);
2127
+ }
2128
+ /**
2129
+ */
2020
2130
  get hq_level() {
2021
2131
  var ret = wasm.__wbg_get_org_hq_level(this.ptr);
2022
2132
  return ret;
@@ -2114,21 +2224,6 @@ class Org {
2114
2224
  wasm.__wbg_set_org_boss_sup(this.ptr, ptr0, len0);
2115
2225
  }
2116
2226
  /**
2117
- * @returns {string}
2118
- */
2119
- get xxh3() {
2120
- try {
2121
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2122
- wasm.org_xxh3(retptr, this.ptr);
2123
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2124
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2125
- return getStringFromWasm0(r0, r1);
2126
- } finally {
2127
- wasm.__wbindgen_add_to_stack_pointer(16);
2128
- wasm.__wbindgen_free(r0, r1);
2129
- }
2130
- }
2131
- /**
2132
2227
  * @param {bindings.Role} role
2133
2228
  * @returns {number}
2134
2229
  */
@@ -2184,8 +2279,8 @@ class Org {
2184
2279
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2185
2280
  wasm.org_fleet_los_mod(retptr, this.ptr, addHeapObject(role));
2186
2281
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2187
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
2188
- return r0 === 0 ? undefined : r1;
2282
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
2283
+ return r0 === 0 ? undefined : r2;
2189
2284
  } finally {
2190
2285
  wasm.__wbindgen_add_to_stack_pointer(16);
2191
2286
  }
@@ -2291,10 +2386,21 @@ class Org {
2291
2386
  * @returns {AirSquadron}
2292
2387
  */
2293
2388
  get_air_squadron(key) {
2294
- var ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2295
- var len0 = WASM_VECTOR_LEN;
2296
- var ret = wasm.org_get_air_squadron(this.ptr, ptr0, len0);
2297
- return AirSquadron.__wrap(ret);
2389
+ try {
2390
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2391
+ var ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2392
+ var len0 = WASM_VECTOR_LEN;
2393
+ wasm.org_get_air_squadron(retptr, this.ptr, ptr0, len0);
2394
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2395
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2396
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2397
+ if (r2) {
2398
+ throw takeObject(r1);
2399
+ }
2400
+ return AirSquadron.__wrap(r0);
2401
+ } finally {
2402
+ wasm.__wbindgen_add_to_stack_pointer(16);
2403
+ }
2298
2404
  }
2299
2405
  /**
2300
2406
  * @returns {(string)[]}
@@ -2439,6 +2545,31 @@ class Ship {
2439
2545
  }
2440
2546
  /**
2441
2547
  */
2548
+ get xxh3() {
2549
+ try {
2550
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2551
+ wasm.__wbg_get_ship_xxh3(retptr, this.ptr);
2552
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2553
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2554
+ u32CvtShim[0] = r0;
2555
+ u32CvtShim[1] = r1;
2556
+ const n0 = uint64CvtShim[0];
2557
+ return n0;
2558
+ } finally {
2559
+ wasm.__wbindgen_add_to_stack_pointer(16);
2560
+ }
2561
+ }
2562
+ /**
2563
+ * @param {BigInt} arg0
2564
+ */
2565
+ set xxh3(arg0) {
2566
+ uint64CvtShim[0] = arg0;
2567
+ const low0 = u32CvtShim[0];
2568
+ const high0 = u32CvtShim[1];
2569
+ wasm.__wbg_set_ship_xxh3(this.ptr, low0, high0);
2570
+ }
2571
+ /**
2572
+ */
2442
2573
  get ship_id() {
2443
2574
  var ret = wasm.__wbg_get_ship_ship_id(this.ptr);
2444
2575
  return ret;
@@ -2649,21 +2780,6 @@ class Ship {
2649
2780
  return ret !== 0;
2650
2781
  }
2651
2782
  /**
2652
- * @returns {string}
2653
- */
2654
- get xxh3() {
2655
- try {
2656
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2657
- wasm.ship_xxh3(retptr, this.ptr);
2658
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2659
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2660
- return getStringFromWasm0(r0, r1);
2661
- } finally {
2662
- wasm.__wbindgen_add_to_stack_pointer(16);
2663
- wasm.__wbindgen_free(r0, r1);
2664
- }
2665
- }
2666
- /**
2667
2783
  * @returns {bindings.ShipState}
2668
2784
  */
2669
2785
  state() {
@@ -3047,8 +3163,8 @@ class Ship {
3047
3163
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3048
3164
  wasm.ship_fleet_los_factor(retptr, this.ptr);
3049
3165
  var r0 = getInt32Memory0()[retptr / 4 + 0];
3050
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
3051
- return r0 === 0 ? undefined : r1;
3166
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3167
+ return r0 === 0 ? undefined : r2;
3052
3168
  } finally {
3053
3169
  wasm.__wbindgen_add_to_stack_pointer(16);
3054
3170
  }
@@ -3068,6 +3184,14 @@ class Ship {
3068
3184
  return ret;
3069
3185
  }
3070
3186
  /**
3187
+ * @param {boolean} is_night
3188
+ * @returns {number}
3189
+ */
3190
+ fit_gun_bonus(is_night) {
3191
+ var ret = wasm.ship_fit_gun_bonus(this.ptr, is_night);
3192
+ return ret;
3193
+ }
3194
+ /**
3071
3195
  * @returns {number | undefined}
3072
3196
  */
3073
3197
  basic_accuracy_term() {
@@ -3075,8 +3199,8 @@ class Ship {
3075
3199
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3076
3200
  wasm.ship_basic_accuracy_term(retptr, this.ptr);
3077
3201
  var r0 = getInt32Memory0()[retptr / 4 + 0];
3078
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
3079
- return r0 === 0 ? undefined : r1;
3202
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3203
+ return r0 === 0 ? undefined : r2;
3080
3204
  } finally {
3081
3205
  wasm.__wbindgen_add_to_stack_pointer(16);
3082
3206
  }
@@ -3089,8 +3213,8 @@ class Ship {
3089
3213
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3090
3214
  wasm.ship_basic_evasion_term(retptr, this.ptr);
3091
3215
  var r0 = getInt32Memory0()[retptr / 4 + 0];
3092
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
3093
- return r0 === 0 ? undefined : r1;
3216
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3217
+ return r0 === 0 ? undefined : r2;
3094
3218
  } finally {
3095
3219
  wasm.__wbindgen_add_to_stack_pointer(16);
3096
3220
  }
@@ -3106,8 +3230,8 @@ class Ship {
3106
3230
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3107
3231
  wasm.ship_evasion_term(retptr, this.ptr, formation_mod, postcap_additive, postcap_multiplicative);
3108
3232
  var r0 = getInt32Memory0()[retptr / 4 + 0];
3109
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
3110
- return r0 === 0 ? undefined : r1;
3233
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3234
+ return r0 === 0 ? undefined : r2;
3111
3235
  } finally {
3112
3236
  wasm.__wbindgen_add_to_stack_pointer(16);
3113
3237
  }
@@ -3121,8 +3245,8 @@ class Ship {
3121
3245
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3122
3246
  wasm.ship_basic_defense_power(retptr, this.ptr, armor_penetration);
3123
3247
  var r0 = getInt32Memory0()[retptr / 4 + 0];
3124
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
3125
- return r0 === 0 ? undefined : r1;
3248
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3249
+ return r0 === 0 ? undefined : r2;
3126
3250
  } finally {
3127
3251
  wasm.__wbindgen_add_to_stack_pointer(16);
3128
3252
  }
@@ -3159,8 +3283,8 @@ class Ship {
3159
3283
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3160
3284
  wasm.ship_elos(retptr, this.ptr, node_divaricated_factor);
3161
3285
  var r0 = getInt32Memory0()[retptr / 4 + 0];
3162
- var r1 = getFloat64Memory0()[retptr / 8 + 1];
3163
- return r0 === 0 ? undefined : r1;
3286
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3287
+ return r0 === 0 ? undefined : r2;
3164
3288
  } finally {
3165
3289
  wasm.__wbindgen_add_to_stack_pointer(16);
3166
3290
  }
@@ -3197,7 +3321,7 @@ module.exports.__wbindgen_json_parse = function(arg0, arg1) {
3197
3321
  return addHeapObject(ret);
3198
3322
  };
3199
3323
 
3200
- module.exports.__wbg_error_cc38ce2b4b661e1d = function(arg0) {
3324
+ module.exports.__wbg_error_ca520cb687b085a1 = function(arg0) {
3201
3325
  console.error(getObject(arg0));
3202
3326
  };
3203
3327
 
@@ -3222,15 +3346,15 @@ module.exports.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
3222
3346
  }
3223
3347
  };
3224
3348
 
3225
- module.exports.__wbg_getRandomValues_98117e9a7e993920 = function() { return handleError(function (arg0, arg1) {
3226
- getObject(arg0).getRandomValues(getObject(arg1));
3349
+ module.exports.__wbg_randomFillSync_59fcc2add91fe7b3 = function() { return handleError(function (arg0, arg1, arg2) {
3350
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3227
3351
  }, arguments) };
3228
3352
 
3229
- module.exports.__wbg_randomFillSync_64cc7d048f228ca8 = function() { return handleError(function (arg0, arg1, arg2) {
3230
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3353
+ module.exports.__wbg_getRandomValues_3e46aa268da0fed1 = function() { return handleError(function (arg0, arg1) {
3354
+ getObject(arg0).getRandomValues(getObject(arg1));
3231
3355
  }, arguments) };
3232
3356
 
3233
- module.exports.__wbg_process_2f24d6544ea7b200 = function(arg0) {
3357
+ module.exports.__wbg_process_f2b73829dbd321da = function(arg0) {
3234
3358
  var ret = getObject(arg0).process;
3235
3359
  return addHeapObject(ret);
3236
3360
  };
@@ -3241,12 +3365,12 @@ module.exports.__wbindgen_is_object = function(arg0) {
3241
3365
  return ret;
3242
3366
  };
3243
3367
 
3244
- module.exports.__wbg_versions_6164651e75405d4a = function(arg0) {
3368
+ module.exports.__wbg_versions_cd82f79c98672a9f = function(arg0) {
3245
3369
  var ret = getObject(arg0).versions;
3246
3370
  return addHeapObject(ret);
3247
3371
  };
3248
3372
 
3249
- module.exports.__wbg_node_4b517d861cbcb3bc = function(arg0) {
3373
+ module.exports.__wbg_node_ee3f6da4130bd35f = function(arg0) {
3250
3374
  var ret = getObject(arg0).node;
3251
3375
  return addHeapObject(ret);
3252
3376
  };
@@ -3256,27 +3380,27 @@ module.exports.__wbindgen_is_string = function(arg0) {
3256
3380
  return ret;
3257
3381
  };
3258
3382
 
3259
- module.exports.__wbg_modulerequire_3440a4bcf44437db = function() { return handleError(function (arg0, arg1) {
3383
+ module.exports.__wbg_modulerequire_0a83c0c31d12d2c7 = function() { return handleError(function (arg0, arg1) {
3260
3384
  var ret = module.require(getStringFromWasm0(arg0, arg1));
3261
3385
  return addHeapObject(ret);
3262
3386
  }, arguments) };
3263
3387
 
3264
- module.exports.__wbg_crypto_98fc271021c7d2ad = function(arg0) {
3388
+ module.exports.__wbg_crypto_9e3521ed42436d35 = function(arg0) {
3265
3389
  var ret = getObject(arg0).crypto;
3266
3390
  return addHeapObject(ret);
3267
3391
  };
3268
3392
 
3269
- module.exports.__wbg_msCrypto_a2cdb043d2bfe57f = function(arg0) {
3393
+ module.exports.__wbg_msCrypto_c429c3f8f7a70bb5 = function(arg0) {
3270
3394
  var ret = getObject(arg0).msCrypto;
3271
3395
  return addHeapObject(ret);
3272
3396
  };
3273
3397
 
3274
- module.exports.__wbg_newnoargs_be86524d73f67598 = function(arg0, arg1) {
3398
+ module.exports.__wbg_newnoargs_f579424187aa1717 = function(arg0, arg1) {
3275
3399
  var ret = new Function(getStringFromWasm0(arg0, arg1));
3276
3400
  return addHeapObject(ret);
3277
3401
  };
3278
3402
 
3279
- module.exports.__wbg_call_888d259a5fefc347 = function() { return handleError(function (arg0, arg1) {
3403
+ module.exports.__wbg_call_89558c3e96703ca1 = function() { return handleError(function (arg0, arg1) {
3280
3404
  var ret = getObject(arg0).call(getObject(arg1));
3281
3405
  return addHeapObject(ret);
3282
3406
  }, arguments) };
@@ -3286,27 +3410,27 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
3286
3410
  return addHeapObject(ret);
3287
3411
  };
3288
3412
 
3289
- module.exports.__wbg_call_8a893cac80deeb51 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
3413
+ module.exports.__wbg_call_471669b9b42539e5 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
3290
3414
  var ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
3291
3415
  return addHeapObject(ret);
3292
3416
  }, arguments) };
3293
3417
 
3294
- module.exports.__wbg_self_c6fbdfc2918d5e58 = function() { return handleError(function () {
3418
+ module.exports.__wbg_self_e23d74ae45fb17d1 = function() { return handleError(function () {
3295
3419
  var ret = self.self;
3296
3420
  return addHeapObject(ret);
3297
3421
  }, arguments) };
3298
3422
 
3299
- module.exports.__wbg_window_baec038b5ab35c54 = function() { return handleError(function () {
3423
+ module.exports.__wbg_window_b4be7f48b24ac56e = function() { return handleError(function () {
3300
3424
  var ret = window.window;
3301
3425
  return addHeapObject(ret);
3302
3426
  }, arguments) };
3303
3427
 
3304
- module.exports.__wbg_globalThis_3f735a5746d41fbd = function() { return handleError(function () {
3428
+ module.exports.__wbg_globalThis_d61b1f48a57191ae = function() { return handleError(function () {
3305
3429
  var ret = globalThis.globalThis;
3306
3430
  return addHeapObject(ret);
3307
3431
  }, arguments) };
3308
3432
 
3309
- module.exports.__wbg_global_1bc0b39582740e95 = function() { return handleError(function () {
3433
+ module.exports.__wbg_global_e7669da72fd7f239 = function() { return handleError(function () {
3310
3434
  var ret = global.global;
3311
3435
  return addHeapObject(ret);
3312
3436
  }, arguments) };
@@ -3316,31 +3440,31 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
3316
3440
  return ret;
3317
3441
  };
3318
3442
 
3319
- module.exports.__wbg_buffer_397eaa4d72ee94dd = function(arg0) {
3443
+ module.exports.__wbg_buffer_5e74a88a1424a2e0 = function(arg0) {
3320
3444
  var ret = getObject(arg0).buffer;
3321
3445
  return addHeapObject(ret);
3322
3446
  };
3323
3447
 
3324
- module.exports.__wbg_new_a7ce447f15ff496f = function(arg0) {
3448
+ module.exports.__wbg_new_e3b800e570795b3c = function(arg0) {
3325
3449
  var ret = new Uint8Array(getObject(arg0));
3326
3450
  return addHeapObject(ret);
3327
3451
  };
3328
3452
 
3329
- module.exports.__wbg_set_969ad0a60e51d320 = function(arg0, arg1, arg2) {
3453
+ module.exports.__wbg_set_5b8081e9d002f0df = function(arg0, arg1, arg2) {
3330
3454
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3331
3455
  };
3332
3456
 
3333
- module.exports.__wbg_length_1eb8fc608a0d4cdb = function(arg0) {
3457
+ module.exports.__wbg_length_30803400a8f15c59 = function(arg0) {
3334
3458
  var ret = getObject(arg0).length;
3335
3459
  return ret;
3336
3460
  };
3337
3461
 
3338
- module.exports.__wbg_newwithlength_929232475839a482 = function(arg0) {
3462
+ module.exports.__wbg_newwithlength_5f4ce114a24dfe1e = function(arg0) {
3339
3463
  var ret = new Uint8Array(arg0 >>> 0);
3340
3464
  return addHeapObject(ret);
3341
3465
  };
3342
3466
 
3343
- module.exports.__wbg_subarray_8b658422a224f479 = function(arg0, arg1, arg2) {
3467
+ module.exports.__wbg_subarray_a68f835ca2af506f = function(arg0, arg1, arg2) {
3344
3468
  var ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3345
3469
  return addHeapObject(ret);
3346
3470
  };
@@ -3357,16 +3481,12 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
3357
3481
  throw new Error(getStringFromWasm0(arg0, arg1));
3358
3482
  };
3359
3483
 
3360
- module.exports.__wbindgen_rethrow = function(arg0) {
3361
- throw takeObject(arg0);
3362
- };
3363
-
3364
3484
  module.exports.__wbindgen_memory = function() {
3365
3485
  var ret = wasm.memory;
3366
3486
  return addHeapObject(ret);
3367
3487
  };
3368
3488
 
3369
- const path = require('path').join(__dirname, 'fh_core_bg.wasm');
3489
+ const path = require('path').join(__dirname, 'fleethub_core_bg.wasm');
3370
3490
  const bytes = require('fs').readFileSync(path);
3371
3491
 
3372
3492
  const wasmModule = new WebAssembly.Module(bytes);