fleethub-core 1.8.8 → 1.8.11

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');
@@ -81,48 +114,16 @@ function getInt32Memory0() {
81
114
  }
82
115
  return cachedInt32Memory0;
83
116
  }
84
-
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;
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;
117
+ /**
118
+ */
119
+ export function set_panic_hook() {
120
+ wasm.set_panic_hook();
116
121
  }
117
122
 
118
123
  const u32CvtShim = new Uint32Array(2);
119
124
 
120
125
  const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
121
126
 
122
- function isLikeNone(x) {
123
- return x === undefined || x === null;
124
- }
125
-
126
127
  let cachedUint32Memory0 = new Uint32Array();
127
128
 
128
129
  function getUint32Memory0() {
@@ -151,6 +152,17 @@ function getFloat64Memory0() {
151
152
  return cachedFloat64Memory0;
152
153
  }
153
154
 
155
+ function _assertClass(instance, klass) {
156
+ if (!(instance instanceof klass)) {
157
+ throw new Error(`expected instance of ${klass.name}`);
158
+ }
159
+ return instance.ptr;
160
+ }
161
+
162
+ function isLikeNone(x) {
163
+ return x === undefined || x === null;
164
+ }
165
+
154
166
  let cachedUint16Memory0 = new Uint16Array();
155
167
 
156
168
  function getUint16Memory0() {
@@ -160,15 +172,6 @@ function getUint16Memory0() {
160
172
  return cachedUint16Memory0;
161
173
  }
162
174
 
163
- function getArrayU16FromWasm0(ptr, len) {
164
- return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
165
- }
166
- /**
167
- */
168
- export function set_panic_hook() {
169
- wasm.set_panic_hook();
170
- }
171
-
172
175
  function passArray16ToWasm0(arg, malloc) {
173
176
  const ptr = malloc(arg.length * 2);
174
177
  getUint16Memory0().set(arg, ptr / 2);
@@ -176,6 +179,18 @@ function passArray16ToWasm0(arg, malloc) {
176
179
  return ptr;
177
180
  }
178
181
 
182
+ function getArrayU16FromWasm0(ptr, len) {
183
+ return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
184
+ }
185
+ /**
186
+ * @param {ShipConditions} value
187
+ * @returns {ShipConditions}
188
+ */
189
+ export function parse_ship_conditions(value) {
190
+ const ret = wasm.parse_ship_conditions(addHeapObject(value));
191
+ return takeObject(ret);
192
+ }
193
+
179
194
  function getArrayU8FromWasm0(ptr, len) {
180
195
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
181
196
  }
@@ -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);
@@ -420,6 +420,21 @@ export class Analyzer {
420
420
  return takeObject(ret);
421
421
  }
422
422
  /**
423
+ * @param {NodeAttackAnalyzerConfig} config
424
+ * @param {Comp} left_comp
425
+ * @param {Comp} right_comp
426
+ * @param {string} attacker_id
427
+ * @returns {NodeAttackAnalysis2 | undefined}
428
+ */
429
+ analyze_node_attack2(config, left_comp, right_comp, attacker_id) {
430
+ _assertClass(left_comp, Comp);
431
+ _assertClass(right_comp, Comp);
432
+ const ptr0 = passStringToWasm0(attacker_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
433
+ const len0 = WASM_VECTOR_LEN;
434
+ const ret = wasm.analyzer_analyze_node_attack2(this.ptr, addHeapObject(config), left_comp.ptr, right_comp.ptr, ptr0, len0);
435
+ return takeObject(ret);
436
+ }
437
+ /**
423
438
  * @param {Comp} comp
424
439
  * @param {CompAnalyzerConfig} config
425
440
  * @returns {CompAnalysis}
@@ -629,34 +644,30 @@ export class Comp {
629
644
  }
630
645
  /**
631
646
  * @param {FleetType} ft
632
- * @param {string} key
647
+ * @param {ShipKey} key
633
648
  * @returns {Ship | undefined}
634
649
  */
635
650
  get_ship_with_clone(ft, key) {
636
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
637
- const len0 = WASM_VECTOR_LEN;
638
- const ret = wasm.comp_get_ship_with_clone(this.ptr, addHeapObject(ft), ptr0, len0);
651
+ const ret = wasm.comp_get_ship_with_clone(this.ptr, addHeapObject(ft), addHeapObject(key));
639
652
  return ret === 0 ? undefined : Ship.__wrap(ret);
640
653
  }
641
654
  /**
642
655
  * @param {FleetType} ft
643
- * @param {string} key
656
+ * @param {ShipKey} key
644
657
  * @returns {string | undefined}
645
658
  */
646
659
  get_ship_entity_id(ft, key) {
647
660
  try {
648
661
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
649
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
650
- const len0 = WASM_VECTOR_LEN;
651
- wasm.comp_get_ship_entity_id(retptr, this.ptr, addHeapObject(ft), ptr0, len0);
662
+ wasm.comp_get_ship_entity_id(retptr, this.ptr, addHeapObject(ft), addHeapObject(key));
652
663
  var r0 = getInt32Memory0()[retptr / 4 + 0];
653
664
  var r1 = getInt32Memory0()[retptr / 4 + 1];
654
- let v1;
665
+ let v0;
655
666
  if (r0 !== 0) {
656
- v1 = getStringFromWasm0(r0, r1).slice();
667
+ v0 = getStringFromWasm0(r0, r1).slice();
657
668
  wasm.__wbindgen_free(r0, r1 * 1);
658
669
  }
659
- return v1;
670
+ return v0;
660
671
  } finally {
661
672
  wasm.__wbindgen_add_to_stack_pointer(16);
662
673
  }
@@ -738,6 +749,21 @@ export class Comp {
738
749
  const ret = wasm.comp_get_ship_conditions(this.ptr, ship.ptr, isLikeNone(formation) ? 0 : addHeapObject(formation));
739
750
  return takeObject(ret);
740
751
  }
752
+ /**
753
+ * @param {FleetType} fleet_type
754
+ * @returns {number | undefined}
755
+ */
756
+ fleet_los_mod(fleet_type) {
757
+ try {
758
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
759
+ wasm.comp_fleet_los_mod(retptr, this.ptr, addHeapObject(fleet_type));
760
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
761
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
762
+ return r0 === 0 ? undefined : r2;
763
+ } finally {
764
+ wasm.__wbindgen_add_to_stack_pointer(16);
765
+ }
766
+ }
741
767
  }
742
768
 
743
769
  const FhCoreFinalization = new FinalizationRegistry(ptr => wasm.__wbg_fhcore_free(ptr));
@@ -1049,13 +1075,11 @@ export class Fleet {
1049
1075
  return ret >>> 0;
1050
1076
  }
1051
1077
  /**
1052
- * @param {string} key
1078
+ * @param {ShipKey} key
1053
1079
  * @returns {Ship | undefined}
1054
1080
  */
1055
1081
  get_ship(key) {
1056
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1057
- const len0 = WASM_VECTOR_LEN;
1058
- const ret = wasm.fleet_get_ship(this.ptr, ptr0, len0);
1082
+ const ret = wasm.fleet_get_ship(this.ptr, addHeapObject(key));
1059
1083
  return ret === 0 ? undefined : Ship.__wrap(ret);
1060
1084
  }
1061
1085
  /**
@@ -1203,7 +1227,7 @@ export class Gear {
1203
1227
  get hash() {
1204
1228
  try {
1205
1229
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1206
- wasm.__wbg_get_gear_hash(retptr, this.ptr);
1230
+ wasm.__wbg_get_airsquadron_hash(retptr, this.ptr);
1207
1231
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1208
1232
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1209
1233
  u32CvtShim[0] = r0;
@@ -1642,232 +1666,6 @@ export class Gear {
1642
1666
  }
1643
1667
  }
1644
1668
 
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
1669
  const OrgFinalization = new FinalizationRegistry(ptr => wasm.__wbg_org_free(ptr));
1872
1670
  /**
1873
1671
  */
@@ -1946,35 +1744,33 @@ export class Org {
1946
1744
  return takeObject(ret);
1947
1745
  }
1948
1746
  /**
1949
- * @returns {string}
1747
+ * @returns {FleetKey}
1950
1748
  */
1951
1749
  get sortie() {
1952
- try {
1953
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1954
- wasm.__wbg_get_org_sortie(retptr, this.ptr);
1955
- var r0 = getInt32Memory0()[retptr / 4 + 0];
1956
- var r1 = getInt32Memory0()[retptr / 4 + 1];
1957
- return getStringFromWasm0(r0, r1);
1958
- } finally {
1959
- wasm.__wbindgen_add_to_stack_pointer(16);
1960
- wasm.__wbindgen_free(r0, r1);
1961
- }
1750
+ const ret = wasm.__wbg_get_org_sortie(this.ptr);
1751
+ return takeObject(ret);
1962
1752
  }
1963
1753
  /**
1964
- * @param {string} arg0
1754
+ * @returns {FleetKey | undefined}
1965
1755
  */
1966
- set sortie(arg0) {
1967
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1968
- const len0 = WASM_VECTOR_LEN;
1969
- wasm.__wbg_set_org_sortie(this.ptr, ptr0, len0);
1756
+ get route_sup() {
1757
+ const ret = wasm.__wbg_get_org_route_sup(this.ptr);
1758
+ return takeObject(ret);
1759
+ }
1760
+ /**
1761
+ * @returns {FleetKey | undefined}
1762
+ */
1763
+ get boss_sup() {
1764
+ const ret = wasm.__wbg_get_org_boss_sup(this.ptr);
1765
+ return takeObject(ret);
1970
1766
  }
1971
1767
  /**
1972
1768
  * @returns {string | undefined}
1973
1769
  */
1974
- get route_sup() {
1770
+ first_ship_id() {
1975
1771
  try {
1976
1772
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1977
- wasm.__wbg_get_org_route_sup(retptr, this.ptr);
1773
+ wasm.org_first_ship_id(retptr, this.ptr);
1978
1774
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1979
1775
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1980
1776
  let v0;
@@ -1988,20 +1784,23 @@ export class Org {
1988
1784
  }
1989
1785
  }
1990
1786
  /**
1991
- * @param {string | undefined} arg0
1787
+ * @param {FleetKey} fleet_key
1788
+ * @param {ShipKey} ship_key
1789
+ * @returns {number | undefined}
1992
1790
  */
1993
- set route_sup(arg0) {
1994
- var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1995
- var len0 = WASM_VECTOR_LEN;
1996
- wasm.__wbg_set_org_route_sup(this.ptr, ptr0, len0);
1791
+ get_ship_mid(fleet_key, ship_key) {
1792
+ const ret = wasm.org_get_ship_mid(this.ptr, addHeapObject(fleet_key), addHeapObject(ship_key));
1793
+ return ret === 0xFFFFFF ? undefined : ret;
1997
1794
  }
1998
1795
  /**
1796
+ * @param {FleetKey} fleet_key
1797
+ * @param {ShipKey} ship_key
1999
1798
  * @returns {string | undefined}
2000
1799
  */
2001
- get boss_sup() {
1800
+ get_ship_eid(fleet_key, ship_key) {
2002
1801
  try {
2003
1802
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2004
- wasm.__wbg_get_org_boss_sup(retptr, this.ptr);
1803
+ wasm.org_get_ship_eid(retptr, this.ptr, addHeapObject(fleet_key), addHeapObject(ship_key));
2005
1804
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2006
1805
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2007
1806
  let v0;
@@ -2015,42 +1814,19 @@ export class Org {
2015
1814
  }
2016
1815
  }
2017
1816
  /**
2018
- * @param {string | undefined} arg0
2019
- */
2020
- set boss_sup(arg0) {
2021
- var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2022
- var len0 = WASM_VECTOR_LEN;
2023
- wasm.__wbg_set_org_boss_sup(this.ptr, ptr0, len0);
2024
- }
2025
- /**
2026
- * @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
- * @param {string} key
2036
- * @returns {string | undefined}
1817
+ * @param {FleetKey} key
1818
+ * @returns {string}
2037
1819
  */
2038
- get_ship_entity_id(role, key) {
1820
+ get_fleet_id(key) {
2039
1821
  try {
2040
1822
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2041
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2042
- const len0 = WASM_VECTOR_LEN;
2043
- wasm.org_get_ship_entity_id(retptr, this.ptr, addHeapObject(role), ptr0, len0);
1823
+ wasm.org_get_fleet_id(retptr, this.ptr, addHeapObject(key));
2044
1824
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2045
1825
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2046
- let v1;
2047
- if (r0 !== 0) {
2048
- v1 = getStringFromWasm0(r0, r1).slice();
2049
- wasm.__wbindgen_free(r0, r1 * 1);
2050
- }
2051
- return v1;
1826
+ return getStringFromWasm0(r0, r1);
2052
1827
  } finally {
2053
1828
  wasm.__wbindgen_add_to_stack_pointer(16);
1829
+ wasm.__wbindgen_free(r0, r1);
2054
1830
  }
2055
1831
  }
2056
1832
  /**
@@ -2070,21 +1846,6 @@ export class Org {
2070
1846
  }
2071
1847
  }
2072
1848
  /**
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
1849
  * @returns {Uint16Array}
2089
1850
  */
2090
1851
  main_ship_ids() {
@@ -2117,24 +1878,20 @@ export class Org {
2117
1878
  }
2118
1879
  }
2119
1880
  /**
2120
- * @param {string} key
1881
+ * @param {FleetKey} key
2121
1882
  * @returns {Fleet}
2122
1883
  */
2123
1884
  clone_fleet(key) {
2124
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2125
- const len0 = WASM_VECTOR_LEN;
2126
- const ret = wasm.org_clone_fleet(this.ptr, ptr0, len0);
1885
+ const ret = wasm.org_clone_fleet(this.ptr, addHeapObject(key));
2127
1886
  return Fleet.__wrap(ret);
2128
1887
  }
2129
1888
  /**
2130
- * @param {Role} role
2131
- * @param {string} key
1889
+ * @param {FleetKey} fleet_key
1890
+ * @param {ShipKey} ship_key
2132
1891
  * @returns {Ship | undefined}
2133
1892
  */
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);
1893
+ clone_ship(fleet_key, ship_key) {
1894
+ const ret = wasm.org_clone_ship(this.ptr, addHeapObject(fleet_key), addHeapObject(ship_key));
2138
1895
  return ret === 0 ? undefined : Ship.__wrap(ret);
2139
1896
  }
2140
1897
  /**
@@ -2148,19 +1905,20 @@ export class Org {
2148
1905
  return ret === 0 ? undefined : Ship.__wrap(ret);
2149
1906
  }
2150
1907
  /**
2151
- * @param {Role} role
2152
- * @returns {string}
1908
+ * @param {FleetKey} key
1909
+ * @returns {(string)[]}
2153
1910
  */
2154
- get_fleet_id_by_role(role) {
1911
+ ship_keys(key) {
2155
1912
  try {
2156
1913
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2157
- wasm.org_get_fleet_id_by_role(retptr, this.ptr, addHeapObject(role));
1914
+ wasm.org_ship_keys(retptr, this.ptr, addHeapObject(key));
2158
1915
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2159
1916
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2160
- return getStringFromWasm0(r0, r1);
1917
+ var v0 = getArrayJsValueFromWasm0(r0, r1).slice();
1918
+ wasm.__wbindgen_free(r0, r1 * 4);
1919
+ return v0;
2161
1920
  } finally {
2162
1921
  wasm.__wbindgen_add_to_stack_pointer(16);
2163
- wasm.__wbindgen_free(r0, r1);
2164
1922
  }
2165
1923
  }
2166
1924
  /**
@@ -2171,13 +1929,11 @@ export class Org {
2171
1929
  return Comp.__wrap(ret);
2172
1930
  }
2173
1931
  /**
2174
- * @param {string} key
1932
+ * @param {FleetKey} key
2175
1933
  * @returns {Comp}
2176
1934
  */
2177
1935
  create_comp_by_key(key) {
2178
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2179
- const len0 = WASM_VECTOR_LEN;
2180
- const ret = wasm.org_create_comp_by_key(this.ptr, ptr0, len0);
1936
+ const ret = wasm.org_create_comp_by_key(this.ptr, addHeapObject(key));
2181
1937
  return Comp.__wrap(ret);
2182
1938
  }
2183
1939
  /**
@@ -2285,11 +2041,24 @@ export class Org {
2285
2041
  return ret;
2286
2042
  }
2287
2043
  /**
2288
- * @returns {Org}
2044
+ * @param {string} id
2045
+ * @param {number} x
2046
+ * @param {number} y
2047
+ * @returns {MoveShipPayload | undefined}
2289
2048
  */
2290
- static default() {
2291
- const ret = wasm.org_default();
2292
- return Org.__wrap(ret);
2049
+ create_move_ship_payload(id, x, y) {
2050
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2051
+ const len0 = WASM_VECTOR_LEN;
2052
+ const ret = wasm.org_create_move_ship_payload(this.ptr, ptr0, len0, x, y);
2053
+ return takeObject(ret);
2054
+ }
2055
+ /**
2056
+ * @param {FleetKey} key
2057
+ * @returns {FleetType | undefined}
2058
+ */
2059
+ get_fleet_type(key) {
2060
+ const ret = wasm.org_get_fleet_type(this.ptr, addHeapObject(key));
2061
+ return takeObject(ret);
2293
2062
  }
2294
2063
  }
2295
2064
 
@@ -2923,6 +2692,13 @@ export class Ship {
2923
2692
  return ret !== 0;
2924
2693
  }
2925
2694
  /**
2695
+ * @returns {boolean}
2696
+ */
2697
+ is_attackable_by_torpedo() {
2698
+ const ret = wasm.ship_is_attackable_by_torpedo(this.ptr);
2699
+ return ret !== 0;
2700
+ }
2701
+ /**
2926
2702
  * @param {number} index
2927
2703
  * @returns {number | undefined}
2928
2704
  */
@@ -3111,6 +2887,15 @@ export class Ship {
3111
2887
  }
3112
2888
  }
3113
2889
 
2890
+ export function __wbindgen_string_new(arg0, arg1) {
2891
+ const ret = getStringFromWasm0(arg0, arg1);
2892
+ return addHeapObject(ret);
2893
+ };
2894
+
2895
+ export function __wbindgen_object_drop_ref(arg0) {
2896
+ takeObject(arg0);
2897
+ };
2898
+
3114
2899
  export function __wbindgen_json_serialize(arg0, arg1) {
3115
2900
  const obj = getObject(arg1);
3116
2901
  const ret = JSON.stringify(obj === undefined ? null : obj);
@@ -3120,16 +2905,7 @@ export function __wbindgen_json_serialize(arg0, arg1) {
3120
2905
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3121
2906
  };
3122
2907
 
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) {
2908
+ export function __wbg_createEquipmentBonuses_90acf8ea4a0803e5(arg0, arg1) {
3133
2909
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3134
2910
  return addHeapObject(ret);
3135
2911
  };