fleethub-core 1.8.8 → 1.8.9

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,13 +1,11 @@
1
1
  import { createEquipmentBonuses } from 'equipment-bonus';
2
2
  import * as wasm from './fleethub_core_bg.wasm';
3
3
 
4
- const heap = new Array(32).fill(undefined);
5
-
6
- heap.push(undefined, null, true, false);
4
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
7
5
 
8
- function getObject(idx) { return heap[idx]; }
6
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
9
7
 
10
- let WASM_VECTOR_LEN = 0;
8
+ cachedTextDecoder.decode();
11
9
 
12
10
  let cachedUint8Memory0 = new Uint8Array();
13
11
 
@@ -18,6 +16,41 @@ function getUint8Memory0() {
18
16
  return cachedUint8Memory0;
19
17
  }
20
18
 
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
+
21
54
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
22
55
 
23
56
  let cachedTextEncoder = new lTextEncoder('utf-8');
@@ -82,45 +115,57 @@ function getInt32Memory0() {
82
115
  return cachedInt32Memory0;
83
116
  }
84
117
 
85
- let heap_next = heap.length;
86
-
87
- function dropObject(idx) {
88
- if (idx < 36) return;
89
- heap[idx] = heap_next;
90
- heap_next = idx;
118
+ function _assertClass(instance, klass) {
119
+ if (!(instance instanceof klass)) {
120
+ throw new Error(`expected instance of ${klass.name}`);
121
+ }
122
+ return instance.ptr;
91
123
  }
92
-
93
- function takeObject(idx) {
94
- const ret = getObject(idx);
95
- dropObject(idx);
96
- return ret;
124
+ /**
125
+ */
126
+ export function set_panic_hook() {
127
+ wasm.set_panic_hook();
97
128
  }
98
129
 
99
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
100
-
101
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
130
+ let cachedFloat64Memory0 = new Float64Array();
102
131
 
103
- cachedTextDecoder.decode();
132
+ function getFloat64Memory0() {
133
+ if (cachedFloat64Memory0.byteLength === 0) {
134
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
135
+ }
136
+ return cachedFloat64Memory0;
137
+ }
104
138
 
105
- function getStringFromWasm0(ptr, len) {
106
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
139
+ function isLikeNone(x) {
140
+ return x === undefined || x === null;
107
141
  }
108
142
 
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];
143
+ let cachedUint16Memory0 = new Uint16Array();
113
144
 
114
- heap[idx] = obj;
115
- return idx;
145
+ function getUint16Memory0() {
146
+ if (cachedUint16Memory0.byteLength === 0) {
147
+ cachedUint16Memory0 = new Uint16Array(wasm.memory.buffer);
148
+ }
149
+ return cachedUint16Memory0;
150
+ }
151
+
152
+ function passArray16ToWasm0(arg, malloc) {
153
+ const ptr = malloc(arg.length * 2);
154
+ getUint16Memory0().set(arg, ptr / 2);
155
+ WASM_VECTOR_LEN = arg.length;
156
+ return ptr;
116
157
  }
117
158
 
118
159
  const u32CvtShim = new Uint32Array(2);
119
160
 
120
161
  const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
121
-
122
- function isLikeNone(x) {
123
- return x === undefined || x === null;
162
+ /**
163
+ * @param {ShipConditions} value
164
+ * @returns {ShipConditions}
165
+ */
166
+ export function parse_ship_conditions(value) {
167
+ const ret = wasm.parse_ship_conditions(addHeapObject(value));
168
+ return takeObject(ret);
124
169
  }
125
170
 
126
171
  let cachedUint32Memory0 = new Uint32Array();
@@ -142,39 +187,9 @@ function getArrayJsValueFromWasm0(ptr, len) {
142
187
  return result;
143
188
  }
144
189
 
145
- let cachedFloat64Memory0 = new Float64Array();
146
-
147
- function getFloat64Memory0() {
148
- if (cachedFloat64Memory0.byteLength === 0) {
149
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
150
- }
151
- return cachedFloat64Memory0;
152
- }
153
-
154
- let cachedUint16Memory0 = new Uint16Array();
155
-
156
- function getUint16Memory0() {
157
- if (cachedUint16Memory0.byteLength === 0) {
158
- cachedUint16Memory0 = new Uint16Array(wasm.memory.buffer);
159
- }
160
- return cachedUint16Memory0;
161
- }
162
-
163
190
  function getArrayU16FromWasm0(ptr, len) {
164
191
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
165
192
  }
166
- /**
167
- */
168
- export function set_panic_hook() {
169
- wasm.set_panic_hook();
170
- }
171
-
172
- function passArray16ToWasm0(arg, malloc) {
173
- const ptr = malloc(arg.length * 2);
174
- getUint16Memory0().set(arg, ptr / 2);
175
- WASM_VECTOR_LEN = arg.length;
176
- return ptr;
177
- }
178
193
 
179
194
  function getArrayU8FromWasm0(ptr, len) {
180
195
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
@@ -187,21 +202,6 @@ function passArray8ToWasm0(arg, malloc) {
187
202
  return ptr;
188
203
  }
189
204
 
190
- function _assertClass(instance, klass) {
191
- if (!(instance instanceof klass)) {
192
- throw new Error(`expected instance of ${klass.name}`);
193
- }
194
- return instance.ptr;
195
- }
196
- /**
197
- * @param {ShipConditions} value
198
- * @returns {ShipConditions}
199
- */
200
- export function parse_ship_conditions(value) {
201
- const ret = wasm.parse_ship_conditions(addHeapObject(value));
202
- return takeObject(ret);
203
- }
204
-
205
205
  function handleError(f, args) {
206
206
  try {
207
207
  return f.apply(this, args);
@@ -1203,7 +1203,7 @@ export class Gear {
1203
1203
  get hash() {
1204
1204
  try {
1205
1205
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1206
- wasm.__wbg_get_gear_hash(retptr, this.ptr);
1206
+ wasm.__wbg_get_airsquadron_hash(retptr, this.ptr);
1207
1207
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1208
1208
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1209
1209
  u32CvtShim[0] = r0;
@@ -1642,232 +1642,6 @@ export class Gear {
1642
1642
  }
1643
1643
  }
1644
1644
 
1645
- const IBonusesFinalization = new FinalizationRegistry(ptr => wasm.__wbg_ibonuses_free(ptr));
1646
- /**
1647
- */
1648
- export class IBonuses {
1649
-
1650
- __destroy_into_raw() {
1651
- const ptr = this.ptr;
1652
- this.ptr = 0;
1653
- IBonusesFinalization.unregister(this);
1654
- return ptr;
1655
- }
1656
-
1657
- free() {
1658
- const ptr = this.__destroy_into_raw();
1659
- wasm.__wbg_ibonuses_free(ptr);
1660
- }
1661
- /**
1662
- * @returns {number}
1663
- */
1664
- get shelling_power() {
1665
- const ret = wasm.__wbg_get_ibonuses_shelling_power(this.ptr);
1666
- return ret;
1667
- }
1668
- /**
1669
- * @param {number} arg0
1670
- */
1671
- set shelling_power(arg0) {
1672
- wasm.__wbg_set_ibonuses_shelling_power(this.ptr, arg0);
1673
- }
1674
- /**
1675
- * @returns {number}
1676
- */
1677
- get carrier_shelling_power() {
1678
- const ret = wasm.__wbg_get_ibonuses_carrier_shelling_power(this.ptr);
1679
- return ret;
1680
- }
1681
- /**
1682
- * @param {number} arg0
1683
- */
1684
- set carrier_shelling_power(arg0) {
1685
- wasm.__wbg_set_ibonuses_carrier_shelling_power(this.ptr, arg0);
1686
- }
1687
- /**
1688
- * @returns {number}
1689
- */
1690
- get shelling_accuracy() {
1691
- const ret = wasm.__wbg_get_ibonuses_shelling_accuracy(this.ptr);
1692
- return ret;
1693
- }
1694
- /**
1695
- * @param {number} arg0
1696
- */
1697
- set shelling_accuracy(arg0) {
1698
- wasm.__wbg_set_ibonuses_shelling_accuracy(this.ptr, arg0);
1699
- }
1700
- /**
1701
- * @returns {number}
1702
- */
1703
- get torpedo_power() {
1704
- const ret = wasm.__wbg_get_ibonuses_torpedo_power(this.ptr);
1705
- return ret;
1706
- }
1707
- /**
1708
- * @param {number} arg0
1709
- */
1710
- set torpedo_power(arg0) {
1711
- wasm.__wbg_set_ibonuses_torpedo_power(this.ptr, arg0);
1712
- }
1713
- /**
1714
- * @returns {number}
1715
- */
1716
- get torpedo_accuracy() {
1717
- const ret = wasm.__wbg_get_ibonuses_torpedo_accuracy(this.ptr);
1718
- return ret;
1719
- }
1720
- /**
1721
- * @param {number} arg0
1722
- */
1723
- set torpedo_accuracy(arg0) {
1724
- wasm.__wbg_set_ibonuses_torpedo_accuracy(this.ptr, arg0);
1725
- }
1726
- /**
1727
- * @returns {number}
1728
- */
1729
- get torpedo_evasion() {
1730
- const ret = wasm.__wbg_get_ibonuses_torpedo_evasion(this.ptr);
1731
- return ret;
1732
- }
1733
- /**
1734
- * @param {number} arg0
1735
- */
1736
- set torpedo_evasion(arg0) {
1737
- wasm.__wbg_set_ibonuses_torpedo_evasion(this.ptr, arg0);
1738
- }
1739
- /**
1740
- * @returns {number}
1741
- */
1742
- get asw_power() {
1743
- const ret = wasm.__wbg_get_ibonuses_asw_power(this.ptr);
1744
- return ret;
1745
- }
1746
- /**
1747
- * @param {number} arg0
1748
- */
1749
- set asw_power(arg0) {
1750
- wasm.__wbg_set_ibonuses_asw_power(this.ptr, arg0);
1751
- }
1752
- /**
1753
- * @returns {number}
1754
- */
1755
- get asw_accuracy() {
1756
- const ret = wasm.__wbg_get_ibonuses_asw_accuracy(this.ptr);
1757
- return ret;
1758
- }
1759
- /**
1760
- * @param {number} arg0
1761
- */
1762
- set asw_accuracy(arg0) {
1763
- wasm.__wbg_set_ibonuses_asw_accuracy(this.ptr, arg0);
1764
- }
1765
- /**
1766
- * @returns {number}
1767
- */
1768
- get night_power() {
1769
- const ret = wasm.__wbg_get_ibonuses_night_power(this.ptr);
1770
- return ret;
1771
- }
1772
- /**
1773
- * @param {number} arg0
1774
- */
1775
- set night_power(arg0) {
1776
- wasm.__wbg_set_ibonuses_night_power(this.ptr, arg0);
1777
- }
1778
- /**
1779
- * @returns {number}
1780
- */
1781
- get night_accuracy() {
1782
- const ret = wasm.__wbg_get_ibonuses_night_accuracy(this.ptr);
1783
- return ret;
1784
- }
1785
- /**
1786
- * @param {number} arg0
1787
- */
1788
- set night_accuracy(arg0) {
1789
- wasm.__wbg_set_ibonuses_night_accuracy(this.ptr, arg0);
1790
- }
1791
- /**
1792
- * @returns {number}
1793
- */
1794
- get defense_power() {
1795
- const ret = wasm.__wbg_get_ibonuses_defense_power(this.ptr);
1796
- return ret;
1797
- }
1798
- /**
1799
- * @param {number} arg0
1800
- */
1801
- set defense_power(arg0) {
1802
- wasm.__wbg_set_ibonuses_defense_power(this.ptr, arg0);
1803
- }
1804
- /**
1805
- * @returns {number}
1806
- */
1807
- get contact_selection() {
1808
- const ret = wasm.__wbg_get_ibonuses_contact_selection(this.ptr);
1809
- return ret;
1810
- }
1811
- /**
1812
- * @param {number} arg0
1813
- */
1814
- set contact_selection(arg0) {
1815
- wasm.__wbg_set_ibonuses_contact_selection(this.ptr, arg0);
1816
- }
1817
- /**
1818
- * @returns {number}
1819
- */
1820
- get fighter_power() {
1821
- const ret = wasm.__wbg_get_ibonuses_fighter_power(this.ptr);
1822
- return ret;
1823
- }
1824
- /**
1825
- * @param {number} arg0
1826
- */
1827
- set fighter_power(arg0) {
1828
- wasm.__wbg_set_ibonuses_fighter_power(this.ptr, arg0);
1829
- }
1830
- /**
1831
- * @returns {number}
1832
- */
1833
- get ship_anti_air() {
1834
- const ret = wasm.__wbg_get_ibonuses_ship_anti_air(this.ptr);
1835
- return ret;
1836
- }
1837
- /**
1838
- * @param {number} arg0
1839
- */
1840
- set ship_anti_air(arg0) {
1841
- wasm.__wbg_set_ibonuses_ship_anti_air(this.ptr, arg0);
1842
- }
1843
- /**
1844
- * @returns {number}
1845
- */
1846
- get fleet_anti_air() {
1847
- const ret = wasm.__wbg_get_ibonuses_fleet_anti_air(this.ptr);
1848
- return ret;
1849
- }
1850
- /**
1851
- * @param {number} arg0
1852
- */
1853
- set fleet_anti_air(arg0) {
1854
- wasm.__wbg_set_ibonuses_fleet_anti_air(this.ptr, arg0);
1855
- }
1856
- /**
1857
- * @returns {number}
1858
- */
1859
- get elos() {
1860
- const ret = wasm.__wbg_get_ibonuses_elos(this.ptr);
1861
- return ret;
1862
- }
1863
- /**
1864
- * @param {number} arg0
1865
- */
1866
- set elos(arg0) {
1867
- wasm.__wbg_set_ibonuses_elos(this.ptr, arg0);
1868
- }
1869
- }
1870
-
1871
1645
  const OrgFinalization = new FinalizationRegistry(ptr => wasm.__wbg_org_free(ptr));
1872
1646
  /**
1873
1647
  */
@@ -2024,14 +1798,6 @@ export class Org {
2024
1798
  }
2025
1799
  /**
2026
1800
  * @param {Role} role
2027
- * @returns {number}
2028
- */
2029
- fleet_len(role) {
2030
- const ret = wasm.org_fleet_len(this.ptr, addHeapObject(role));
2031
- return ret >>> 0;
2032
- }
2033
- /**
2034
- * @param {Role} role
2035
1801
  * @param {string} key
2036
1802
  * @returns {string | undefined}
2037
1803
  */
@@ -2070,21 +1836,6 @@ export class Org {
2070
1836
  }
2071
1837
  }
2072
1838
  /**
2073
- * @param {Role} role
2074
- * @returns {number | undefined}
2075
- */
2076
- fleet_los_mod(role) {
2077
- try {
2078
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2079
- wasm.org_fleet_los_mod(retptr, this.ptr, addHeapObject(role));
2080
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2081
- var r2 = getFloat64Memory0()[retptr / 8 + 1];
2082
- return r0 === 0 ? undefined : r2;
2083
- } finally {
2084
- wasm.__wbindgen_add_to_stack_pointer(16);
2085
- }
2086
- }
2087
- /**
2088
1839
  * @returns {Uint16Array}
2089
1840
  */
2090
1841
  main_ship_ids() {
@@ -2127,17 +1878,6 @@ export class Org {
2127
1878
  return Fleet.__wrap(ret);
2128
1879
  }
2129
1880
  /**
2130
- * @param {Role} role
2131
- * @param {string} key
2132
- * @returns {Ship | undefined}
2133
- */
2134
- get_ship(role, key) {
2135
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2136
- const len0 = WASM_VECTOR_LEN;
2137
- const ret = wasm.org_get_ship(this.ptr, addHeapObject(role), ptr0, len0);
2138
- return ret === 0 ? undefined : Ship.__wrap(ret);
2139
- }
2140
- /**
2141
1881
  * @param {string} id
2142
1882
  * @returns {Ship | undefined}
2143
1883
  */
@@ -2148,22 +1888,6 @@ export class Org {
2148
1888
  return ret === 0 ? undefined : Ship.__wrap(ret);
2149
1889
  }
2150
1890
  /**
2151
- * @param {Role} role
2152
- * @returns {string}
2153
- */
2154
- get_fleet_id_by_role(role) {
2155
- try {
2156
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2157
- wasm.org_get_fleet_id_by_role(retptr, this.ptr, addHeapObject(role));
2158
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2159
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2160
- return getStringFromWasm0(r0, r1);
2161
- } finally {
2162
- wasm.__wbindgen_add_to_stack_pointer(16);
2163
- wasm.__wbindgen_free(r0, r1);
2164
- }
2165
- }
2166
- /**
2167
1891
  * @returns {Comp}
2168
1892
  */
2169
1893
  create_comp() {
@@ -2284,13 +2008,6 @@ export class Org {
2284
2008
  const ret = wasm.org_high_altitude_interception_power(this.ptr);
2285
2009
  return ret;
2286
2010
  }
2287
- /**
2288
- * @returns {Org}
2289
- */
2290
- static default() {
2291
- const ret = wasm.org_default();
2292
- return Org.__wrap(ret);
2293
- }
2294
2011
  }
2295
2012
 
2296
2013
  const ShipFinalization = new FinalizationRegistry(ptr => wasm.__wbg_ship_free(ptr));
@@ -3111,6 +2828,15 @@ export class Ship {
3111
2828
  }
3112
2829
  }
3113
2830
 
2831
+ export function __wbindgen_string_new(arg0, arg1) {
2832
+ const ret = getStringFromWasm0(arg0, arg1);
2833
+ return addHeapObject(ret);
2834
+ };
2835
+
2836
+ export function __wbindgen_object_drop_ref(arg0) {
2837
+ takeObject(arg0);
2838
+ };
2839
+
3114
2840
  export function __wbindgen_json_serialize(arg0, arg1) {
3115
2841
  const obj = getObject(arg1);
3116
2842
  const ret = JSON.stringify(obj === undefined ? null : obj);
@@ -3120,16 +2846,7 @@ export function __wbindgen_json_serialize(arg0, arg1) {
3120
2846
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3121
2847
  };
3122
2848
 
3123
- export function __wbindgen_object_drop_ref(arg0) {
3124
- takeObject(arg0);
3125
- };
3126
-
3127
- export function __wbindgen_string_new(arg0, arg1) {
3128
- const ret = getStringFromWasm0(arg0, arg1);
3129
- return addHeapObject(ret);
3130
- };
3131
-
3132
- export function __wbg_createEquipmentBonuses_d565e4083bca7b6e(arg0, arg1) {
2849
+ export function __wbg_createEquipmentBonuses_c15680c31fad94ad(arg0, arg1) {
3133
2850
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3134
2851
  return addHeapObject(ret);
3135
2852
  };
Binary file