fleethub-core 1.8.10 → 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.
- package/node/fleethub_core.d.ts +161 -136
- package/node/fleethub_core.js +98 -76
- package/node/fleethub_core_bg.wasm +0 -0
- package/node/fleethub_core_bg.wasm.d.ts +29 -27
- package/package.json +1 -1
- package/pkg/fleethub_core.d.ts +161 -136
- package/pkg/fleethub_core_bg.js +97 -75
- package/pkg/fleethub_core_bg.wasm +0 -0
- package/pkg/fleethub_core_bg.wasm.d.ts +29 -27
package/node/fleethub_core.d.ts
CHANGED
|
@@ -8,8 +8,6 @@ export function set_panic_hook(): void;
|
|
|
8
8
|
* @returns {ShipConditions}
|
|
9
9
|
*/
|
|
10
10
|
export function parse_ship_conditions(value: ShipConditions): ShipConditions;
|
|
11
|
-
export type Side = "Player" | "Enemy";
|
|
12
|
-
|
|
13
11
|
export interface ShipPosition {
|
|
14
12
|
org_type?: OrgType;
|
|
15
13
|
fleet_type?: FleetType;
|
|
@@ -34,56 +32,35 @@ export interface ShipMeta {
|
|
|
34
32
|
|
|
35
33
|
export type Engagement = "GreenT" | "Parallel" | "HeadOn" | "RedT";
|
|
36
34
|
|
|
37
|
-
export
|
|
38
|
-
formation: Record<Formation, NestedFormationDef>;
|
|
39
|
-
anti_air_cutin: Record<number, AntiAirCutinDef>;
|
|
40
|
-
day_cutin: Record<DayCutin, DayCutinDef>;
|
|
41
|
-
night_cutin: Record<NightCutin, NightCutinDef>;
|
|
42
|
-
}
|
|
35
|
+
export type TorpedoAttackType = null;
|
|
43
36
|
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
type_factor: number | null;
|
|
48
|
-
power_mod: number | null;
|
|
49
|
-
accuracy_mod: number | null;
|
|
50
|
-
}
|
|
37
|
+
export type NightPhaseAttackType =
|
|
38
|
+
| { t: "Night"; c: NightAttackType }
|
|
39
|
+
| { t: "Asw"; c: AswAttackType };
|
|
51
40
|
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
type_factor: number | null;
|
|
56
|
-
power_mod: number | null;
|
|
57
|
-
accuracy_mod: number | null;
|
|
58
|
-
}
|
|
41
|
+
export type DayPhaseAttackType =
|
|
42
|
+
| { t: "Shelling"; c: ShellingType }
|
|
43
|
+
| { t: "Asw"; c: AswAttackType };
|
|
59
44
|
|
|
60
|
-
export
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
45
|
+
export type AttackType =
|
|
46
|
+
| { t: "Asw"; c: AswAttackType }
|
|
47
|
+
| { t: "Shelling"; c: ShellingType }
|
|
48
|
+
| { t: "Night"; c: NightAttackType }
|
|
49
|
+
| { t: "Torpedo" }
|
|
50
|
+
| { t: "SupportShelling"; c: SupportShellingType };
|
|
67
51
|
|
|
68
|
-
export type
|
|
69
|
-
| FormationDef
|
|
70
|
-
| { top_half: FormationDef; bottom_half: FormationDef };
|
|
52
|
+
export type SupportShellingType = ShellingType;
|
|
71
53
|
|
|
72
|
-
export
|
|
73
|
-
tag: Formation;
|
|
74
|
-
protection_rate: number | null;
|
|
75
|
-
fleet_anti_air_mod: number;
|
|
76
|
-
shelling: FormationCombatModifiersDef;
|
|
77
|
-
torpedo: FormationCombatModifiersDef;
|
|
78
|
-
asw: FormationCombatModifiersDef;
|
|
79
|
-
night: FormationCombatModifiersDef;
|
|
80
|
-
support_shelling: FormationCombatModifiersDef;
|
|
81
|
-
}
|
|
54
|
+
export type NightAttackType = "Normal" | "Swordfish" | "Carrier";
|
|
82
55
|
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
56
|
+
export type ShellingType = "Normal" | "Carrier";
|
|
57
|
+
|
|
58
|
+
export type AswAttackType = "DepthCharge" | "Aircraft";
|
|
59
|
+
|
|
60
|
+
export type FhResult<T> = { Ok: T } | { Err: string };
|
|
61
|
+
|
|
62
|
+
export interface NodeAttackAnalysis2 {
|
|
63
|
+
data: AttackAnalysis[];
|
|
87
64
|
}
|
|
88
65
|
|
|
89
66
|
export type CompiledEvaler = string;
|
|
@@ -181,6 +158,24 @@ export interface ActionReport<T> {
|
|
|
181
158
|
is_active: boolean;
|
|
182
159
|
}
|
|
183
160
|
|
|
161
|
+
export type GearTypeIdArray = [number, number, number, number, number];
|
|
162
|
+
|
|
163
|
+
export type SpecialEnemyType =
|
|
164
|
+
| "None"
|
|
165
|
+
| "SoftSkinned"
|
|
166
|
+
| "Pillbox"
|
|
167
|
+
| "IsolatedIsland"
|
|
168
|
+
| "SupplyDepot"
|
|
169
|
+
| "NewSupplyDepot"
|
|
170
|
+
| "HarbourSummerPrincess"
|
|
171
|
+
| "PtImp"
|
|
172
|
+
| "BattleshipSummerPrincess"
|
|
173
|
+
| "HeavyCruiserSummerPrincess";
|
|
174
|
+
|
|
175
|
+
export type Align = "Left" | "Right";
|
|
176
|
+
|
|
177
|
+
export type Side = "Player" | "Enemy";
|
|
178
|
+
|
|
184
179
|
export type ShipType =
|
|
185
180
|
| "Unknown"
|
|
186
181
|
| "DE"
|
|
@@ -216,47 +211,6 @@ export type ShipCategory =
|
|
|
216
211
|
| "Submarine"
|
|
217
212
|
| "AuxiliaryShip";
|
|
218
213
|
|
|
219
|
-
export type NightCutinLike = NightCutin | FleetCutin;
|
|
220
|
-
|
|
221
|
-
export type DayCutinLike = DayCutin | FleetCutin;
|
|
222
|
-
|
|
223
|
-
export type FleetCutin =
|
|
224
|
-
| "NelsonTouch"
|
|
225
|
-
| "NagatoClassCutin"
|
|
226
|
-
| "ColoradoClassCutin"
|
|
227
|
-
| "KongouClassCutin"
|
|
228
|
-
| "Yamato2ShipCutin"
|
|
229
|
-
| "Yamato3ShipCutin";
|
|
230
|
-
|
|
231
|
-
export type NightCutin =
|
|
232
|
-
| "MainTorpRadar"
|
|
233
|
-
| "TorpLookoutRadar"
|
|
234
|
-
| "TorpTsloTorp"
|
|
235
|
-
| "TorpTsloDrum"
|
|
236
|
-
| "DoubleAttack"
|
|
237
|
-
| "TorpTorpMain"
|
|
238
|
-
| "TorpTorpTorp"
|
|
239
|
-
| "MainMainSec"
|
|
240
|
-
| "MainMainMain"
|
|
241
|
-
| "SubTorpTorp"
|
|
242
|
-
| "SubRadarTorp"
|
|
243
|
-
| "Cvci1_25"
|
|
244
|
-
| "Cvci1_20"
|
|
245
|
-
| "Cvci1_18"
|
|
246
|
-
| "Photobomber";
|
|
247
|
-
|
|
248
|
-
export type DayCutin =
|
|
249
|
-
| "Zuiun"
|
|
250
|
-
| "AirSea"
|
|
251
|
-
| "MainMain"
|
|
252
|
-
| "MainAp"
|
|
253
|
-
| "MainRadar"
|
|
254
|
-
| "MainSec"
|
|
255
|
-
| "DoubleAttack"
|
|
256
|
-
| "FBA"
|
|
257
|
-
| "BBA"
|
|
258
|
-
| "BA";
|
|
259
|
-
|
|
260
214
|
export interface MasterIBonuses {
|
|
261
215
|
shelling_power: MasterIBonusRule[];
|
|
262
216
|
shelling_accuracy: MasterIBonusRule[];
|
|
@@ -305,10 +259,51 @@ export interface MoveShipPayload {
|
|
|
305
259
|
target: [string | null, string, ShipKey];
|
|
306
260
|
}
|
|
307
261
|
|
|
308
|
-
export type GearTypeIdArray = [number, number, number, number, number];
|
|
309
|
-
|
|
310
262
|
export type MoraleState = "Sparkle" | "Normal" | "Orange" | "Red";
|
|
311
263
|
|
|
264
|
+
export type NightCutinLike = NightCutin | FleetCutin;
|
|
265
|
+
|
|
266
|
+
export type DayCutinLike = DayCutin | FleetCutin;
|
|
267
|
+
|
|
268
|
+
export type FleetCutin =
|
|
269
|
+
| "NelsonTouch"
|
|
270
|
+
| "NagatoClassCutin"
|
|
271
|
+
| "ColoradoClassCutin"
|
|
272
|
+
| "KongouClassCutin"
|
|
273
|
+
| "Yamato2ShipCutin"
|
|
274
|
+
| "Yamato3ShipCutin";
|
|
275
|
+
|
|
276
|
+
export type NightCutin =
|
|
277
|
+
| "MainTorpRadar"
|
|
278
|
+
| "TorpLookoutRadar"
|
|
279
|
+
| "TorpTsloTorp"
|
|
280
|
+
| "TorpTsloDrum"
|
|
281
|
+
| "DoubleAttack"
|
|
282
|
+
| "TorpTorpMain"
|
|
283
|
+
| "TorpTorpTorp"
|
|
284
|
+
| "MainMainSec"
|
|
285
|
+
| "MainMainMain"
|
|
286
|
+
| "SubTorpTorp"
|
|
287
|
+
| "SubRadarTorp"
|
|
288
|
+
| "Cvci1_25"
|
|
289
|
+
| "Cvci1_20"
|
|
290
|
+
| "Cvci1_18"
|
|
291
|
+
| "Photobomber";
|
|
292
|
+
|
|
293
|
+
export type DayCutin =
|
|
294
|
+
| "Zuiun"
|
|
295
|
+
| "AirSea"
|
|
296
|
+
| "MainMain"
|
|
297
|
+
| "MainAp"
|
|
298
|
+
| "MainRadar"
|
|
299
|
+
| "MainSec"
|
|
300
|
+
| "DoubleAttack"
|
|
301
|
+
| "FBA"
|
|
302
|
+
| "BBA"
|
|
303
|
+
| "BA";
|
|
304
|
+
|
|
305
|
+
export type ContactRank = "Rank1" | "Rank2" | "Rank3";
|
|
306
|
+
|
|
312
307
|
export type AirWaveType = "Jet" | "LandBase" | "Carrier";
|
|
313
308
|
|
|
314
309
|
export interface SimulatorResult {
|
|
@@ -323,21 +318,8 @@ export interface SimulatorResultItem {
|
|
|
323
318
|
damage_state_map: Record<DamageState, number>;
|
|
324
319
|
}
|
|
325
320
|
|
|
326
|
-
export type SpecialEnemyType =
|
|
327
|
-
| "None"
|
|
328
|
-
| "SoftSkinned"
|
|
329
|
-
| "Pillbox"
|
|
330
|
-
| "IsolatedIsland"
|
|
331
|
-
| "SupplyDepot"
|
|
332
|
-
| "HarbourSummerPrincess"
|
|
333
|
-
| "PtImp"
|
|
334
|
-
| "BattleshipSummerPrincess"
|
|
335
|
-
| "HeavyCruiserSummerPrincess";
|
|
336
|
-
|
|
337
321
|
export type ShipKey = "s1" | "s2" | "s3" | "s4" | "s5" | "s6" | "s7";
|
|
338
322
|
|
|
339
|
-
export type ContactRank = "Rank1" | "Rank2" | "Rank3";
|
|
340
|
-
|
|
341
323
|
export type GearCategory =
|
|
342
324
|
| "Fighter"
|
|
343
325
|
| "Bomber"
|
|
@@ -416,31 +398,6 @@ export type GearType =
|
|
|
416
398
|
|
|
417
399
|
export type DamageState = "Normal" | "Shouha" | "Chuuha" | "Taiha" | "Sunk";
|
|
418
400
|
|
|
419
|
-
export type TorpedoAttackType = null;
|
|
420
|
-
|
|
421
|
-
export type NightPhaseAttackType =
|
|
422
|
-
| { t: "Night"; c: NightAttackType }
|
|
423
|
-
| { t: "Asw"; c: AswAttackType };
|
|
424
|
-
|
|
425
|
-
export type DayPhaseAttackType =
|
|
426
|
-
| { t: "Shelling"; c: ShellingType }
|
|
427
|
-
| { t: "Asw"; c: AswAttackType };
|
|
428
|
-
|
|
429
|
-
export type AttackType =
|
|
430
|
-
| { t: "Asw"; c: AswAttackType }
|
|
431
|
-
| { t: "Shelling"; c: ShellingType }
|
|
432
|
-
| { t: "Night"; c: NightAttackType }
|
|
433
|
-
| { t: "Torpedo" }
|
|
434
|
-
| { t: "SupportShelling"; c: SupportShellingType };
|
|
435
|
-
|
|
436
|
-
export type SupportShellingType = ShellingType;
|
|
437
|
-
|
|
438
|
-
export type NightAttackType = "Normal" | "Swordfish" | "Carrier";
|
|
439
|
-
|
|
440
|
-
export type ShellingType = "Normal" | "Carrier";
|
|
441
|
-
|
|
442
|
-
export type AswAttackType = "DepthCharge" | "Aircraft";
|
|
443
|
-
|
|
444
401
|
export type AirStateRank = "Rank0" | "Rank1" | "Rank2" | "Rank3";
|
|
445
402
|
|
|
446
403
|
export type AirState =
|
|
@@ -450,8 +407,6 @@ export type AirState =
|
|
|
450
407
|
| "AirDenial"
|
|
451
408
|
| "AirIncapability";
|
|
452
409
|
|
|
453
|
-
export type FhResult<T> = { Ok: T } | { Err: string };
|
|
454
|
-
|
|
455
410
|
export interface MasterData extends MasterBattleDefinitions {
|
|
456
411
|
created_at: number;
|
|
457
412
|
gears: MasterGear[];
|
|
@@ -545,6 +500,7 @@ export type ShipAttr =
|
|
|
545
500
|
| "IsolatedIsland"
|
|
546
501
|
| "HarbourSummerPrincess"
|
|
547
502
|
| "SupplyDepot"
|
|
503
|
+
| "NewSupplyDepot"
|
|
548
504
|
| "PtImp"
|
|
549
505
|
| "BattleshipSummerPrincess"
|
|
550
506
|
| "HeavyCruiserSummerPrincess";
|
|
@@ -557,6 +513,65 @@ export type OrgType =
|
|
|
557
513
|
| "EnemySingle"
|
|
558
514
|
| "EnemyCombined";
|
|
559
515
|
|
|
516
|
+
export interface BattleDefinitions {
|
|
517
|
+
formation: Record<Formation, NestedFormationDef>;
|
|
518
|
+
anti_air_cutin: Record<number, AntiAirCutinDef>;
|
|
519
|
+
day_cutin: Record<DayCutin, DayCutinDef>;
|
|
520
|
+
night_cutin: Record<NightCutin, NightCutinDef>;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export interface NightCutinDef {
|
|
524
|
+
tag: NightCutin;
|
|
525
|
+
hits: number;
|
|
526
|
+
type_factor: number | null;
|
|
527
|
+
power_mod: number | null;
|
|
528
|
+
accuracy_mod: number | null;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export interface DayCutinDef {
|
|
532
|
+
tag: DayCutin;
|
|
533
|
+
hits: number;
|
|
534
|
+
type_factor: number | null;
|
|
535
|
+
power_mod: number | null;
|
|
536
|
+
accuracy_mod: number | null;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export interface AntiAirCutinDef {
|
|
540
|
+
id: number;
|
|
541
|
+
type_factor: number | null;
|
|
542
|
+
multiplier: number | null;
|
|
543
|
+
guaranteed: number | null;
|
|
544
|
+
sequential: boolean | null;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export type NestedFormationDef =
|
|
548
|
+
| FormationDef
|
|
549
|
+
| { top_half: FormationDef; bottom_half: FormationDef };
|
|
550
|
+
|
|
551
|
+
export interface FormationDef {
|
|
552
|
+
tag: Formation;
|
|
553
|
+
protection_rate: number | null;
|
|
554
|
+
fleet_anti_air_mod: number;
|
|
555
|
+
shelling: FormationCombatModifiersDef;
|
|
556
|
+
torpedo: FormationCombatModifiersDef;
|
|
557
|
+
asw: FormationCombatModifiersDef;
|
|
558
|
+
night: FormationCombatModifiersDef;
|
|
559
|
+
support_shelling: FormationCombatModifiersDef;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export interface FormationCombatModifiersDef {
|
|
563
|
+
power_mod?: number;
|
|
564
|
+
accuracy_mod?: number;
|
|
565
|
+
evasion_mod?: number;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export interface ShipAnalyzerConfig {
|
|
569
|
+
air_state?: AirState;
|
|
570
|
+
engagement?: Engagement;
|
|
571
|
+
left?: AttackAnalyzerShipConfig;
|
|
572
|
+
right?: AttackAnalyzerShipConfig;
|
|
573
|
+
}
|
|
574
|
+
|
|
560
575
|
export type GearAttr =
|
|
561
576
|
| "Unknown"
|
|
562
577
|
| "Abyssal"
|
|
@@ -597,13 +612,6 @@ export interface SupportShellingSimulatorParams {
|
|
|
597
612
|
engagement: Engagement;
|
|
598
613
|
}
|
|
599
614
|
|
|
600
|
-
export interface ShipAnalyzerConfig {
|
|
601
|
-
air_state?: AirState;
|
|
602
|
-
engagement?: Engagement;
|
|
603
|
-
left?: AttackAnalyzerShipConfig;
|
|
604
|
-
right?: AttackAnalyzerShipConfig;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
615
|
export interface CompAntiAirAnalysis {
|
|
608
616
|
fleet_adjusted_anti_air: number;
|
|
609
617
|
ships: AntiAirReport[];
|
|
@@ -1068,6 +1076,19 @@ export class Analyzer {
|
|
|
1068
1076
|
right_comp: Comp,
|
|
1069
1077
|
right_ship: Ship
|
|
1070
1078
|
): NodeAttackAnalysis;
|
|
1079
|
+
/**
|
|
1080
|
+
* @param {NodeAttackAnalyzerConfig} config
|
|
1081
|
+
* @param {Comp} left_comp
|
|
1082
|
+
* @param {Comp} right_comp
|
|
1083
|
+
* @param {string} attacker_id
|
|
1084
|
+
* @returns {NodeAttackAnalysis2 | undefined}
|
|
1085
|
+
*/
|
|
1086
|
+
analyze_node_attack2(
|
|
1087
|
+
config: NodeAttackAnalyzerConfig,
|
|
1088
|
+
left_comp: Comp,
|
|
1089
|
+
right_comp: Comp,
|
|
1090
|
+
attacker_id: string
|
|
1091
|
+
): NodeAttackAnalysis2 | undefined;
|
|
1071
1092
|
/**
|
|
1072
1093
|
* @param {Comp} comp
|
|
1073
1094
|
* @param {CompAnalyzerConfig} config
|
|
@@ -1859,6 +1880,10 @@ export class Ship {
|
|
|
1859
1880
|
* @returns {boolean}
|
|
1860
1881
|
*/
|
|
1861
1882
|
is_pt_imp(): boolean;
|
|
1883
|
+
/**
|
|
1884
|
+
* @returns {boolean}
|
|
1885
|
+
*/
|
|
1886
|
+
is_attackable_by_torpedo(): boolean;
|
|
1862
1887
|
/**
|
|
1863
1888
|
* @param {number} index
|
|
1864
1889
|
* @returns {number | undefined}
|
package/node/fleethub_core.js
CHANGED
|
@@ -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 {
|
|
5
|
+
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
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'
|
|
@@ -82,42 +113,34 @@ function getInt32Memory0() {
|
|
|
82
113
|
}
|
|
83
114
|
return cachedInt32Memory0;
|
|
84
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
*/
|
|
118
|
+
module.exports.set_panic_hook = function() {
|
|
119
|
+
wasm.set_panic_hook();
|
|
120
|
+
};
|
|
85
121
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
cachedTextDecoder.decode();
|
|
89
|
-
|
|
90
|
-
function getStringFromWasm0(ptr, len) {
|
|
91
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
let heap_next = heap.length;
|
|
122
|
+
const u32CvtShim = new Uint32Array(2);
|
|
95
123
|
|
|
96
|
-
|
|
97
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
98
|
-
const idx = heap_next;
|
|
99
|
-
heap_next = heap[idx];
|
|
124
|
+
const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
|
|
100
125
|
|
|
101
|
-
|
|
102
|
-
return idx;
|
|
103
|
-
}
|
|
126
|
+
let cachedUint32Memory0 = new Uint32Array();
|
|
104
127
|
|
|
105
|
-
function
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
|
|
128
|
+
function getUint32Memory0() {
|
|
129
|
+
if (cachedUint32Memory0.byteLength === 0) {
|
|
130
|
+
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
131
|
+
}
|
|
132
|
+
return cachedUint32Memory0;
|
|
109
133
|
}
|
|
110
134
|
|
|
111
|
-
function
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
135
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
136
|
+
const mem = getUint32Memory0();
|
|
137
|
+
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
138
|
+
const result = [];
|
|
139
|
+
for (let i = 0; i < slice.length; i++) {
|
|
140
|
+
result.push(takeObject(slice[i]));
|
|
141
|
+
}
|
|
142
|
+
return result;
|
|
115
143
|
}
|
|
116
|
-
/**
|
|
117
|
-
*/
|
|
118
|
-
module.exports.set_panic_hook = function() {
|
|
119
|
-
wasm.set_panic_hook();
|
|
120
|
-
};
|
|
121
144
|
|
|
122
145
|
let cachedFloat64Memory0 = new Float64Array();
|
|
123
146
|
|
|
@@ -128,6 +151,13 @@ function getFloat64Memory0() {
|
|
|
128
151
|
return cachedFloat64Memory0;
|
|
129
152
|
}
|
|
130
153
|
|
|
154
|
+
function _assertClass(instance, klass) {
|
|
155
|
+
if (!(instance instanceof klass)) {
|
|
156
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
157
|
+
}
|
|
158
|
+
return instance.ptr;
|
|
159
|
+
}
|
|
160
|
+
|
|
131
161
|
function isLikeNone(x) {
|
|
132
162
|
return x === undefined || x === null;
|
|
133
163
|
}
|
|
@@ -148,39 +178,9 @@ function passArray16ToWasm0(arg, malloc) {
|
|
|
148
178
|
return ptr;
|
|
149
179
|
}
|
|
150
180
|
|
|
151
|
-
const u32CvtShim = new Uint32Array(2);
|
|
152
|
-
|
|
153
|
-
const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
|
|
154
|
-
|
|
155
|
-
let cachedUint32Memory0 = new Uint32Array();
|
|
156
|
-
|
|
157
|
-
function getUint32Memory0() {
|
|
158
|
-
if (cachedUint32Memory0.byteLength === 0) {
|
|
159
|
-
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
160
|
-
}
|
|
161
|
-
return cachedUint32Memory0;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
165
|
-
const mem = getUint32Memory0();
|
|
166
|
-
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
167
|
-
const result = [];
|
|
168
|
-
for (let i = 0; i < slice.length; i++) {
|
|
169
|
-
result.push(takeObject(slice[i]));
|
|
170
|
-
}
|
|
171
|
-
return result;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
181
|
function getArrayU16FromWasm0(ptr, len) {
|
|
175
182
|
return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len);
|
|
176
183
|
}
|
|
177
|
-
|
|
178
|
-
function _assertClass(instance, klass) {
|
|
179
|
-
if (!(instance instanceof klass)) {
|
|
180
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
181
|
-
}
|
|
182
|
-
return instance.ptr;
|
|
183
|
-
}
|
|
184
184
|
/**
|
|
185
185
|
* @param {ShipConditions} value
|
|
186
186
|
* @returns {ShipConditions}
|
|
@@ -420,6 +420,21 @@ 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}
|
|
@@ -2683,6 +2698,13 @@ class Ship {
|
|
|
2683
2698
|
return ret !== 0;
|
|
2684
2699
|
}
|
|
2685
2700
|
/**
|
|
2701
|
+
* @returns {boolean}
|
|
2702
|
+
*/
|
|
2703
|
+
is_attackable_by_torpedo() {
|
|
2704
|
+
const ret = wasm.ship_is_attackable_by_torpedo(this.ptr);
|
|
2705
|
+
return ret !== 0;
|
|
2706
|
+
}
|
|
2707
|
+
/**
|
|
2686
2708
|
* @param {number} index
|
|
2687
2709
|
* @returns {number | undefined}
|
|
2688
2710
|
*/
|
|
@@ -2872,15 +2894,6 @@ class Ship {
|
|
|
2872
2894
|
}
|
|
2873
2895
|
module.exports.Ship = Ship;
|
|
2874
2896
|
|
|
2875
|
-
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
2876
|
-
const obj = getObject(arg1);
|
|
2877
|
-
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
2878
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2879
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2880
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
2881
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
2882
|
-
};
|
|
2883
|
-
|
|
2884
2897
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
2885
2898
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2886
2899
|
return addHeapObject(ret);
|
|
@@ -2890,7 +2903,16 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
2890
2903
|
takeObject(arg0);
|
|
2891
2904
|
};
|
|
2892
2905
|
|
|
2893
|
-
module.exports.
|
|
2906
|
+
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
2907
|
+
const obj = getObject(arg1);
|
|
2908
|
+
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
2909
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2910
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2911
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
2912
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
2913
|
+
};
|
|
2914
|
+
|
|
2915
|
+
module.exports.__wbg_createEquipmentBonuses_90acf8ea4a0803e5 = function(arg0, arg1) {
|
|
2894
2916
|
const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
|
|
2895
2917
|
return addHeapObject(ret);
|
|
2896
2918
|
};
|
|
Binary file
|