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.
@@ -2,15 +2,11 @@ let imports = {};
2
2
  imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
4
  const { createEquipmentBonuses } = require(`equipment-bonus`);
5
- const { TextEncoder, TextDecoder } = require(`util`);
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
- const heap = new Array(32).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
7
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
12
8
 
13
- let WASM_VECTOR_LEN = 0;
9
+ cachedTextDecoder.decode();
14
10
 
15
11
  let cachedUint8Memory0 = new Uint8Array();
16
12
 
@@ -21,6 +17,41 @@ function getUint8Memory0() {
21
17
  return cachedUint8Memory0;
22
18
  }
23
19
 
20
+ function getStringFromWasm0(ptr, len) {
21
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
22
+ }
23
+
24
+ const heap = new Array(32).fill(undefined);
25
+
26
+ heap.push(undefined, null, true, false);
27
+
28
+ let heap_next = heap.length;
29
+
30
+ function addHeapObject(obj) {
31
+ if (heap_next === heap.length) heap.push(heap.length + 1);
32
+ const idx = heap_next;
33
+ heap_next = heap[idx];
34
+
35
+ heap[idx] = obj;
36
+ return idx;
37
+ }
38
+
39
+ function getObject(idx) { return heap[idx]; }
40
+
41
+ function dropObject(idx) {
42
+ if (idx < 36) return;
43
+ heap[idx] = heap_next;
44
+ heap_next = idx;
45
+ }
46
+
47
+ function takeObject(idx) {
48
+ const ret = getObject(idx);
49
+ dropObject(idx);
50
+ return ret;
51
+ }
52
+
53
+ let WASM_VECTOR_LEN = 0;
54
+
24
55
  let cachedTextEncoder = new TextEncoder('utf-8');
25
56
 
26
57
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -83,44 +114,58 @@ function getInt32Memory0() {
83
114
  return cachedInt32Memory0;
84
115
  }
85
116
 
86
- let heap_next = heap.length;
87
-
88
- function dropObject(idx) {
89
- if (idx < 36) return;
90
- heap[idx] = heap_next;
91
- heap_next = idx;
117
+ function _assertClass(instance, klass) {
118
+ if (!(instance instanceof klass)) {
119
+ throw new Error(`expected instance of ${klass.name}`);
120
+ }
121
+ return instance.ptr;
92
122
  }
123
+ /**
124
+ */
125
+ module.exports.set_panic_hook = function() {
126
+ wasm.set_panic_hook();
127
+ };
93
128
 
94
- function takeObject(idx) {
95
- const ret = getObject(idx);
96
- dropObject(idx);
97
- return ret;
129
+ let cachedFloat64Memory0 = new Float64Array();
130
+
131
+ function getFloat64Memory0() {
132
+ if (cachedFloat64Memory0.byteLength === 0) {
133
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
134
+ }
135
+ return cachedFloat64Memory0;
98
136
  }
99
137
 
100
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
138
+ function isLikeNone(x) {
139
+ return x === undefined || x === null;
140
+ }
101
141
 
102
- cachedTextDecoder.decode();
142
+ let cachedUint16Memory0 = new Uint16Array();
103
143
 
104
- function getStringFromWasm0(ptr, len) {
105
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
144
+ function getUint16Memory0() {
145
+ if (cachedUint16Memory0.byteLength === 0) {
146
+ cachedUint16Memory0 = new Uint16Array(wasm.memory.buffer);
147
+ }
148
+ return cachedUint16Memory0;
106
149
  }
107
150
 
108
- function addHeapObject(obj) {
109
- if (heap_next === heap.length) heap.push(heap.length + 1);
110
- const idx = heap_next;
111
- heap_next = heap[idx];
112
-
113
- heap[idx] = obj;
114
- return idx;
151
+ function passArray16ToWasm0(arg, malloc) {
152
+ const ptr = malloc(arg.length * 2);
153
+ getUint16Memory0().set(arg, ptr / 2);
154
+ WASM_VECTOR_LEN = arg.length;
155
+ return ptr;
115
156
  }
116
157
 
117
158
  const u32CvtShim = new Uint32Array(2);
118
159
 
119
160
  const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
120
-
121
- function isLikeNone(x) {
122
- return x === undefined || x === null;
123
- }
161
+ /**
162
+ * @param {ShipConditions} value
163
+ * @returns {ShipConditions}
164
+ */
165
+ module.exports.parse_ship_conditions = function(value) {
166
+ const ret = wasm.parse_ship_conditions(addHeapObject(value));
167
+ return takeObject(ret);
168
+ };
124
169
 
125
170
  let cachedUint32Memory0 = new Uint32Array();
126
171
 
@@ -141,39 +186,9 @@ function getArrayJsValueFromWasm0(ptr, len) {
141
186
  return result;
142
187
  }
143
188
 
144
- let cachedFloat64Memory0 = new Float64Array();
145
-
146
- function getFloat64Memory0() {
147
- if (cachedFloat64Memory0.byteLength === 0) {
148
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
149
- }
150
- return cachedFloat64Memory0;
151
- }
152
-
153
- let cachedUint16Memory0 = new Uint16Array();
154
-
155
- function getUint16Memory0() {
156
- if (cachedUint16Memory0.byteLength === 0) {
157
- cachedUint16Memory0 = new Uint16Array(wasm.memory.buffer);
158
- }
159
- return cachedUint16Memory0;
160
- }
161
-
162
189
  function getArrayU16FromWasm0(ptr, len) {
163
190
  return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
164
191
  }
165
- /**
166
- */
167
- module.exports.set_panic_hook = function() {
168
- wasm.set_panic_hook();
169
- };
170
-
171
- function passArray16ToWasm0(arg, malloc) {
172
- const ptr = malloc(arg.length * 2);
173
- getUint16Memory0().set(arg, ptr / 2);
174
- WASM_VECTOR_LEN = arg.length;
175
- return ptr;
176
- }
177
192
 
178
193
  function getArrayU8FromWasm0(ptr, len) {
179
194
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
@@ -186,21 +201,6 @@ function passArray8ToWasm0(arg, malloc) {
186
201
  return ptr;
187
202
  }
188
203
 
189
- function _assertClass(instance, klass) {
190
- if (!(instance instanceof klass)) {
191
- throw new Error(`expected instance of ${klass.name}`);
192
- }
193
- return instance.ptr;
194
- }
195
- /**
196
- * @param {ShipConditions} value
197
- * @returns {ShipConditions}
198
- */
199
- module.exports.parse_ship_conditions = function(value) {
200
- const ret = wasm.parse_ship_conditions(addHeapObject(value));
201
- return takeObject(ret);
202
- };
203
-
204
204
  function handleError(f, args) {
205
205
  try {
206
206
  return f.apply(this, args);
@@ -1207,7 +1207,7 @@ class Gear {
1207
1207
  get hash() {
1208
1208
  try {
1209
1209
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1210
- wasm.__wbg_get_gear_hash(retptr, this.ptr);
1210
+ wasm.__wbg_get_airsquadron_hash(retptr, this.ptr);
1211
1211
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1212
1212
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1213
1213
  u32CvtShim[0] = r0;
@@ -1647,233 +1647,6 @@ class Gear {
1647
1647
  }
1648
1648
  module.exports.Gear = Gear;
1649
1649
 
1650
- const IBonusesFinalization = new FinalizationRegistry(ptr => wasm.__wbg_ibonuses_free(ptr));
1651
- /**
1652
- */
1653
- class IBonuses {
1654
-
1655
- __destroy_into_raw() {
1656
- const ptr = this.ptr;
1657
- this.ptr = 0;
1658
- IBonusesFinalization.unregister(this);
1659
- return ptr;
1660
- }
1661
-
1662
- free() {
1663
- const ptr = this.__destroy_into_raw();
1664
- wasm.__wbg_ibonuses_free(ptr);
1665
- }
1666
- /**
1667
- * @returns {number}
1668
- */
1669
- get shelling_power() {
1670
- const ret = wasm.__wbg_get_ibonuses_shelling_power(this.ptr);
1671
- return ret;
1672
- }
1673
- /**
1674
- * @param {number} arg0
1675
- */
1676
- set shelling_power(arg0) {
1677
- wasm.__wbg_set_ibonuses_shelling_power(this.ptr, arg0);
1678
- }
1679
- /**
1680
- * @returns {number}
1681
- */
1682
- get carrier_shelling_power() {
1683
- const ret = wasm.__wbg_get_ibonuses_carrier_shelling_power(this.ptr);
1684
- return ret;
1685
- }
1686
- /**
1687
- * @param {number} arg0
1688
- */
1689
- set carrier_shelling_power(arg0) {
1690
- wasm.__wbg_set_ibonuses_carrier_shelling_power(this.ptr, arg0);
1691
- }
1692
- /**
1693
- * @returns {number}
1694
- */
1695
- get shelling_accuracy() {
1696
- const ret = wasm.__wbg_get_ibonuses_shelling_accuracy(this.ptr);
1697
- return ret;
1698
- }
1699
- /**
1700
- * @param {number} arg0
1701
- */
1702
- set shelling_accuracy(arg0) {
1703
- wasm.__wbg_set_ibonuses_shelling_accuracy(this.ptr, arg0);
1704
- }
1705
- /**
1706
- * @returns {number}
1707
- */
1708
- get torpedo_power() {
1709
- const ret = wasm.__wbg_get_ibonuses_torpedo_power(this.ptr);
1710
- return ret;
1711
- }
1712
- /**
1713
- * @param {number} arg0
1714
- */
1715
- set torpedo_power(arg0) {
1716
- wasm.__wbg_set_ibonuses_torpedo_power(this.ptr, arg0);
1717
- }
1718
- /**
1719
- * @returns {number}
1720
- */
1721
- get torpedo_accuracy() {
1722
- const ret = wasm.__wbg_get_ibonuses_torpedo_accuracy(this.ptr);
1723
- return ret;
1724
- }
1725
- /**
1726
- * @param {number} arg0
1727
- */
1728
- set torpedo_accuracy(arg0) {
1729
- wasm.__wbg_set_ibonuses_torpedo_accuracy(this.ptr, arg0);
1730
- }
1731
- /**
1732
- * @returns {number}
1733
- */
1734
- get torpedo_evasion() {
1735
- const ret = wasm.__wbg_get_ibonuses_torpedo_evasion(this.ptr);
1736
- return ret;
1737
- }
1738
- /**
1739
- * @param {number} arg0
1740
- */
1741
- set torpedo_evasion(arg0) {
1742
- wasm.__wbg_set_ibonuses_torpedo_evasion(this.ptr, arg0);
1743
- }
1744
- /**
1745
- * @returns {number}
1746
- */
1747
- get asw_power() {
1748
- const ret = wasm.__wbg_get_ibonuses_asw_power(this.ptr);
1749
- return ret;
1750
- }
1751
- /**
1752
- * @param {number} arg0
1753
- */
1754
- set asw_power(arg0) {
1755
- wasm.__wbg_set_ibonuses_asw_power(this.ptr, arg0);
1756
- }
1757
- /**
1758
- * @returns {number}
1759
- */
1760
- get asw_accuracy() {
1761
- const ret = wasm.__wbg_get_ibonuses_asw_accuracy(this.ptr);
1762
- return ret;
1763
- }
1764
- /**
1765
- * @param {number} arg0
1766
- */
1767
- set asw_accuracy(arg0) {
1768
- wasm.__wbg_set_ibonuses_asw_accuracy(this.ptr, arg0);
1769
- }
1770
- /**
1771
- * @returns {number}
1772
- */
1773
- get night_power() {
1774
- const ret = wasm.__wbg_get_ibonuses_night_power(this.ptr);
1775
- return ret;
1776
- }
1777
- /**
1778
- * @param {number} arg0
1779
- */
1780
- set night_power(arg0) {
1781
- wasm.__wbg_set_ibonuses_night_power(this.ptr, arg0);
1782
- }
1783
- /**
1784
- * @returns {number}
1785
- */
1786
- get night_accuracy() {
1787
- const ret = wasm.__wbg_get_ibonuses_night_accuracy(this.ptr);
1788
- return ret;
1789
- }
1790
- /**
1791
- * @param {number} arg0
1792
- */
1793
- set night_accuracy(arg0) {
1794
- wasm.__wbg_set_ibonuses_night_accuracy(this.ptr, arg0);
1795
- }
1796
- /**
1797
- * @returns {number}
1798
- */
1799
- get defense_power() {
1800
- const ret = wasm.__wbg_get_ibonuses_defense_power(this.ptr);
1801
- return ret;
1802
- }
1803
- /**
1804
- * @param {number} arg0
1805
- */
1806
- set defense_power(arg0) {
1807
- wasm.__wbg_set_ibonuses_defense_power(this.ptr, arg0);
1808
- }
1809
- /**
1810
- * @returns {number}
1811
- */
1812
- get contact_selection() {
1813
- const ret = wasm.__wbg_get_ibonuses_contact_selection(this.ptr);
1814
- return ret;
1815
- }
1816
- /**
1817
- * @param {number} arg0
1818
- */
1819
- set contact_selection(arg0) {
1820
- wasm.__wbg_set_ibonuses_contact_selection(this.ptr, arg0);
1821
- }
1822
- /**
1823
- * @returns {number}
1824
- */
1825
- get fighter_power() {
1826
- const ret = wasm.__wbg_get_ibonuses_fighter_power(this.ptr);
1827
- return ret;
1828
- }
1829
- /**
1830
- * @param {number} arg0
1831
- */
1832
- set fighter_power(arg0) {
1833
- wasm.__wbg_set_ibonuses_fighter_power(this.ptr, arg0);
1834
- }
1835
- /**
1836
- * @returns {number}
1837
- */
1838
- get ship_anti_air() {
1839
- const ret = wasm.__wbg_get_ibonuses_ship_anti_air(this.ptr);
1840
- return ret;
1841
- }
1842
- /**
1843
- * @param {number} arg0
1844
- */
1845
- set ship_anti_air(arg0) {
1846
- wasm.__wbg_set_ibonuses_ship_anti_air(this.ptr, arg0);
1847
- }
1848
- /**
1849
- * @returns {number}
1850
- */
1851
- get fleet_anti_air() {
1852
- const ret = wasm.__wbg_get_ibonuses_fleet_anti_air(this.ptr);
1853
- return ret;
1854
- }
1855
- /**
1856
- * @param {number} arg0
1857
- */
1858
- set fleet_anti_air(arg0) {
1859
- wasm.__wbg_set_ibonuses_fleet_anti_air(this.ptr, arg0);
1860
- }
1861
- /**
1862
- * @returns {number}
1863
- */
1864
- get elos() {
1865
- const ret = wasm.__wbg_get_ibonuses_elos(this.ptr);
1866
- return ret;
1867
- }
1868
- /**
1869
- * @param {number} arg0
1870
- */
1871
- set elos(arg0) {
1872
- wasm.__wbg_set_ibonuses_elos(this.ptr, arg0);
1873
- }
1874
- }
1875
- module.exports.IBonuses = IBonuses;
1876
-
1877
1650
  const OrgFinalization = new FinalizationRegistry(ptr => wasm.__wbg_org_free(ptr));
1878
1651
  /**
1879
1652
  */
@@ -2030,14 +1803,6 @@ class Org {
2030
1803
  }
2031
1804
  /**
2032
1805
  * @param {Role} role
2033
- * @returns {number}
2034
- */
2035
- fleet_len(role) {
2036
- const ret = wasm.org_fleet_len(this.ptr, addHeapObject(role));
2037
- return ret >>> 0;
2038
- }
2039
- /**
2040
- * @param {Role} role
2041
1806
  * @param {string} key
2042
1807
  * @returns {string | undefined}
2043
1808
  */
@@ -2076,21 +1841,6 @@ class Org {
2076
1841
  }
2077
1842
  }
2078
1843
  /**
2079
- * @param {Role} role
2080
- * @returns {number | undefined}
2081
- */
2082
- fleet_los_mod(role) {
2083
- try {
2084
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2085
- wasm.org_fleet_los_mod(retptr, this.ptr, addHeapObject(role));
2086
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2087
- var r2 = getFloat64Memory0()[retptr / 8 + 1];
2088
- return r0 === 0 ? undefined : r2;
2089
- } finally {
2090
- wasm.__wbindgen_add_to_stack_pointer(16);
2091
- }
2092
- }
2093
- /**
2094
1844
  * @returns {Uint16Array}
2095
1845
  */
2096
1846
  main_ship_ids() {
@@ -2133,17 +1883,6 @@ class Org {
2133
1883
  return Fleet.__wrap(ret);
2134
1884
  }
2135
1885
  /**
2136
- * @param {Role} role
2137
- * @param {string} key
2138
- * @returns {Ship | undefined}
2139
- */
2140
- get_ship(role, key) {
2141
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2142
- const len0 = WASM_VECTOR_LEN;
2143
- const ret = wasm.org_get_ship(this.ptr, addHeapObject(role), ptr0, len0);
2144
- return ret === 0 ? undefined : Ship.__wrap(ret);
2145
- }
2146
- /**
2147
1886
  * @param {string} id
2148
1887
  * @returns {Ship | undefined}
2149
1888
  */
@@ -2154,22 +1893,6 @@ class Org {
2154
1893
  return ret === 0 ? undefined : Ship.__wrap(ret);
2155
1894
  }
2156
1895
  /**
2157
- * @param {Role} role
2158
- * @returns {string}
2159
- */
2160
- get_fleet_id_by_role(role) {
2161
- try {
2162
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2163
- wasm.org_get_fleet_id_by_role(retptr, this.ptr, addHeapObject(role));
2164
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2165
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2166
- return getStringFromWasm0(r0, r1);
2167
- } finally {
2168
- wasm.__wbindgen_add_to_stack_pointer(16);
2169
- wasm.__wbindgen_free(r0, r1);
2170
- }
2171
- }
2172
- /**
2173
1896
  * @returns {Comp}
2174
1897
  */
2175
1898
  create_comp() {
@@ -2290,13 +2013,6 @@ class Org {
2290
2013
  const ret = wasm.org_high_altitude_interception_power(this.ptr);
2291
2014
  return ret;
2292
2015
  }
2293
- /**
2294
- * @returns {Org}
2295
- */
2296
- static default() {
2297
- const ret = wasm.org_default();
2298
- return Org.__wrap(ret);
2299
- }
2300
2016
  }
2301
2017
  module.exports.Org = Org;
2302
2018
 
@@ -3119,6 +2835,15 @@ class Ship {
3119
2835
  }
3120
2836
  module.exports.Ship = Ship;
3121
2837
 
2838
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
2839
+ const ret = getStringFromWasm0(arg0, arg1);
2840
+ return addHeapObject(ret);
2841
+ };
2842
+
2843
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
2844
+ takeObject(arg0);
2845
+ };
2846
+
3122
2847
  module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
3123
2848
  const obj = getObject(arg1);
3124
2849
  const ret = JSON.stringify(obj === undefined ? null : obj);
@@ -3128,16 +2853,7 @@ module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
3128
2853
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3129
2854
  };
3130
2855
 
3131
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
3132
- takeObject(arg0);
3133
- };
3134
-
3135
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
3136
- const ret = getStringFromWasm0(arg0, arg1);
3137
- return addHeapObject(ret);
3138
- };
3139
-
3140
- module.exports.__wbg_createEquipmentBonuses_d565e4083bca7b6e = function(arg0, arg1) {
2856
+ module.exports.__wbg_createEquipmentBonuses_c15680c31fad94ad = function(arg0, arg1) {
3141
2857
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3142
2858
  return addHeapObject(ret);
3143
2859
  };
Binary file