fleethub-core 1.8.12 → 1.9.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.
@@ -1,11 +1,13 @@
1
1
  import { createEquipmentBonuses } from 'equipment-bonus';
2
2
  import * as wasm from './fleethub_core_bg.wasm';
3
3
 
4
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
4
+ const heap = new Array(32).fill(undefined);
5
5
 
6
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
6
+ heap.push(undefined, null, true, false);
7
7
 
8
- cachedTextDecoder.decode();
8
+ function getObject(idx) { return heap[idx]; }
9
+
10
+ let WASM_VECTOR_LEN = 0;
9
11
 
10
12
  let cachedUint8Memory0 = new Uint8Array();
11
13
 
@@ -16,41 +18,6 @@ function getUint8Memory0() {
16
18
  return cachedUint8Memory0;
17
19
  }
18
20
 
19
- function getStringFromWasm0(ptr, len) {
20
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
21
- }
22
-
23
- const heap = new Array(32).fill(undefined);
24
-
25
- heap.push(undefined, null, true, false);
26
-
27
- let heap_next = heap.length;
28
-
29
- function addHeapObject(obj) {
30
- if (heap_next === heap.length) heap.push(heap.length + 1);
31
- const idx = heap_next;
32
- heap_next = heap[idx];
33
-
34
- heap[idx] = obj;
35
- return idx;
36
- }
37
-
38
- function getObject(idx) { return heap[idx]; }
39
-
40
- function dropObject(idx) {
41
- if (idx < 36) return;
42
- heap[idx] = heap_next;
43
- heap_next = idx;
44
- }
45
-
46
- function takeObject(idx) {
47
- const ret = getObject(idx);
48
- dropObject(idx);
49
- return ret;
50
- }
51
-
52
- let WASM_VECTOR_LEN = 0;
53
-
54
21
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
55
22
 
56
23
  let cachedTextEncoder = new lTextEncoder('utf-8');
@@ -115,13 +82,37 @@ function getInt32Memory0() {
115
82
  return cachedInt32Memory0;
116
83
  }
117
84
 
118
- let cachedFloat64Memory0 = new Float64Array();
85
+ let heap_next = heap.length;
119
86
 
120
- function getFloat64Memory0() {
121
- if (cachedFloat64Memory0.byteLength === 0) {
122
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
123
- }
124
- return cachedFloat64Memory0;
87
+ function dropObject(idx) {
88
+ if (idx < 36) return;
89
+ heap[idx] = heap_next;
90
+ heap_next = idx;
91
+ }
92
+
93
+ function takeObject(idx) {
94
+ const ret = getObject(idx);
95
+ dropObject(idx);
96
+ return ret;
97
+ }
98
+
99
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
100
+
101
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
102
+
103
+ cachedTextDecoder.decode();
104
+
105
+ function getStringFromWasm0(ptr, len) {
106
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
107
+ }
108
+
109
+ function addHeapObject(obj) {
110
+ if (heap_next === heap.length) heap.push(heap.length + 1);
111
+ const idx = heap_next;
112
+ heap_next = heap[idx];
113
+
114
+ heap[idx] = obj;
115
+ return idx;
125
116
  }
126
117
 
127
118
  function _assertClass(instance, klass) {
@@ -131,6 +122,15 @@ function _assertClass(instance, klass) {
131
122
  return instance.ptr;
132
123
  }
133
124
 
125
+ let cachedFloat64Memory0 = new Float64Array();
126
+
127
+ function getFloat64Memory0() {
128
+ if (cachedFloat64Memory0.byteLength === 0) {
129
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
130
+ }
131
+ return cachedFloat64Memory0;
132
+ }
133
+
134
134
  function isLikeNone(x) {
135
135
  return x === undefined || x === null;
136
136
  }
@@ -403,21 +403,6 @@ export class Analyzer {
403
403
  return takeObject(ret);
404
404
  }
405
405
  /**
406
- * @param {NodeAttackAnalyzerConfig} config
407
- * @param {Comp} left_comp
408
- * @param {Comp} right_comp
409
- * @param {string} attacker_id
410
- * @returns {NodeAttackAnalysis2 | undefined}
411
- */
412
- analyze_node_attack2(config, left_comp, right_comp, attacker_id) {
413
- _assertClass(left_comp, Comp);
414
- _assertClass(right_comp, Comp);
415
- const ptr0 = passStringToWasm0(attacker_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
416
- const len0 = WASM_VECTOR_LEN;
417
- const ret = wasm.analyzer_analyze_node_attack2(this.ptr, addHeapObject(config), left_comp.ptr, right_comp.ptr, ptr0, len0);
418
- return takeObject(ret);
419
- }
420
- /**
421
406
  * @param {Comp} comp
422
407
  * @param {CompAnalyzerConfig} config
423
408
  * @returns {CompAnalysis}
@@ -2539,6 +2524,13 @@ export class Ship {
2539
2524
  return ret !== 0;
2540
2525
  }
2541
2526
  /**
2527
+ * @returns {boolean}
2528
+ */
2529
+ is_amagiri() {
2530
+ const ret = wasm.ship_is_amagiri(this.ptr);
2531
+ return ret !== 0;
2532
+ }
2533
+ /**
2542
2534
  * @param {Gear} gear
2543
2535
  * @param {string} key
2544
2536
  * @returns {boolean}
@@ -2837,15 +2829,6 @@ export class Ship {
2837
2829
  }
2838
2830
  }
2839
2831
 
2840
- export function __wbindgen_string_new(arg0, arg1) {
2841
- const ret = getStringFromWasm0(arg0, arg1);
2842
- return addHeapObject(ret);
2843
- };
2844
-
2845
- export function __wbindgen_object_drop_ref(arg0) {
2846
- takeObject(arg0);
2847
- };
2848
-
2849
2832
  export function __wbindgen_json_serialize(arg0, arg1) {
2850
2833
  const obj = getObject(arg1);
2851
2834
  const ret = JSON.stringify(obj === undefined ? null : obj);
@@ -2855,7 +2838,16 @@ export function __wbindgen_json_serialize(arg0, arg1) {
2855
2838
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
2856
2839
  };
2857
2840
 
2858
- export function __wbg_createEquipmentBonuses_15500ac43151ffc3(arg0, arg1) {
2841
+ export function __wbindgen_object_drop_ref(arg0) {
2842
+ takeObject(arg0);
2843
+ };
2844
+
2845
+ export function __wbindgen_string_new(arg0, arg1) {
2846
+ const ret = getStringFromWasm0(arg0, arg1);
2847
+ return addHeapObject(ret);
2848
+ };
2849
+
2850
+ export function __wbg_createEquipmentBonuses_0efacdeef0fe5ffd(arg0, arg1) {
2859
2851
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
2860
2852
  return addHeapObject(ret);
2861
2853
  };
Binary file
@@ -1,15 +1,14 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function ship_state_day_gunfit_accuracy(a: number, b: number): void;
5
- export function ship_state_night_gunfit_accuracy(a: number, b: number): void;
6
- export function ship_gunfit_accuracy(a: number, b: number): number;
7
4
  export function __wbg_analyzer_free(a: number): void;
8
5
  export function analyzer_analyze_ship_attack(a: number, b: number, c: number, d: number, e: number): number;
9
6
  export function analyzer_analyze_node_attack(a: number, b: number, c: number, d: number, e: number, f: number): number;
10
- export function analyzer_analyze_node_attack2(a: number, b: number, c: number, d: number, e: number, f: number): number;
11
7
  export function analyzer_analyze_comp(a: number, b: number, c: number): number;
12
8
  export function analyzer_simulate_support_shelling(a: number, b: number, c: number, d: number, e: number, f: number): void;
9
+ export function ship_state_day_gunfit_accuracy(a: number, b: number): void;
10
+ export function ship_state_night_gunfit_accuracy(a: number, b: number): void;
11
+ export function ship_gunfit_accuracy(a: number, b: number): number;
13
12
  export function __wbg_fhcore_free(a: number): void;
14
13
  export function fhcore_new(a: number, b: number): void;
15
14
  export function fhcore_create_gear(a: number, b: number): number;
@@ -143,6 +142,7 @@ export function ship_get_ebonus(a: number, b: number, c: number): number;
143
142
  export function ship_get_stat_mod(a: number, b: number, c: number): number;
144
143
  export function ship_is_abyssal(a: number): number;
145
144
  export function ship_is_submarine(a: number): number;
145
+ export function ship_is_amagiri(a: number): number;
146
146
  export function ship_can_equip(a: number, b: number, c: number, d: number): number;
147
147
  export function ship_max_hp(a: number): number;
148
148
  export function ship_max_ammo(a: number): number;