fleethub-core 1.8.0 → 1.8.3

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.
@@ -19,6 +19,30 @@ export interface ShipConditions extends ShipPosition {
19
19
  formation?: Formation;
20
20
  }
21
21
 
22
+ declare namespace Role {
23
+ export type Main = "Main";
24
+ export type Escort = "Escort";
25
+ }
26
+
27
+ export type Role = Role.Main | Role.Escort;
28
+
29
+ declare namespace OrgType {
30
+ export type Single = "Single";
31
+ export type CarrierTaskForce = "CarrierTaskForce";
32
+ export type SurfaceTaskForce = "SurfaceTaskForce";
33
+ export type TransportEscort = "TransportEscort";
34
+ export type EnemySingle = "EnemySingle";
35
+ export type EnemyCombined = "EnemyCombined";
36
+ }
37
+
38
+ export type OrgType =
39
+ | OrgType.Single
40
+ | OrgType.CarrierTaskForce
41
+ | OrgType.SurfaceTaskForce
42
+ | OrgType.TransportEscort
43
+ | OrgType.EnemySingle
44
+ | OrgType.EnemyCombined;
45
+
22
46
  export interface BattleDefinitions {
23
47
  formation: Record<Formation, NestedFormationDef>;
24
48
  anti_air_cutin: Record<number, AntiAirCutinDef>;
@@ -236,33 +260,11 @@ export interface SimulatorResult {
236
260
 
237
261
  export interface SimulatorResultItem {
238
262
  id: string;
239
- role: Role;
263
+ fleet_type: FleetType;
240
264
  index: number;
241
265
  damage_state_map: Record<DamageState, number>;
242
266
  }
243
267
 
244
- declare namespace DamageState {
245
- export type Normal = "Normal";
246
- export type Shouha = "Shouha";
247
- export type Chuuha = "Chuuha";
248
- export type Taiha = "Taiha";
249
- export type Sunk = "Sunk";
250
- }
251
-
252
- export type DamageState =
253
- | DamageState.Normal
254
- | DamageState.Shouha
255
- | DamageState.Chuuha
256
- | DamageState.Taiha
257
- | DamageState.Sunk;
258
-
259
- export interface ShipPosition {
260
- org_type?: OrgType;
261
- role?: Role;
262
- fleet_len?: number;
263
- index?: number;
264
- }
265
-
266
268
  declare namespace GearCategory {
267
269
  export type Fighter = "Fighter";
268
270
  export type Bomber = "Bomber";
@@ -352,6 +354,7 @@ declare namespace GearType {
352
354
  export type JetRecon = "JetRecon";
353
355
  export type LargeRadar2 = "LargeRadar2";
354
356
  export type CbRecon2 = "CbRecon2";
357
+ export type SecondaryGun2 = "SecondaryGun2";
355
358
  }
356
359
 
357
360
  export type GearType =
@@ -413,20 +416,51 @@ export type GearType =
413
416
  | GearType.JetTorpedoBomber
414
417
  | GearType.JetRecon
415
418
  | GearType.LargeRadar2
416
- | GearType.CbRecon2;
419
+ | GearType.CbRecon2
420
+ | GearType.SecondaryGun2;
417
421
 
418
- declare namespace FleetType {
419
- export type Main = "Main";
420
- export type Escort = "Escort";
421
- export type RouteSup = "RouteSup";
422
- export type BossSup = "BossSup";
422
+ declare namespace DamageState {
423
+ export type Normal = "Normal";
424
+ export type Shouha = "Shouha";
425
+ export type Chuuha = "Chuuha";
426
+ export type Taiha = "Taiha";
427
+ export type Sunk = "Sunk";
423
428
  }
424
429
 
425
- export type FleetType =
426
- | FleetType.Main
427
- | FleetType.Escort
428
- | FleetType.RouteSup
429
- | FleetType.BossSup;
430
+ export type DamageState =
431
+ | DamageState.Normal
432
+ | DamageState.Shouha
433
+ | DamageState.Chuuha
434
+ | DamageState.Taiha
435
+ | DamageState.Sunk;
436
+
437
+ declare namespace AirStateRank {
438
+ export type Rank0 = "Rank0";
439
+ export type Rank1 = "Rank1";
440
+ export type Rank2 = "Rank2";
441
+ export type Rank3 = "Rank3";
442
+ }
443
+
444
+ export type AirStateRank =
445
+ | AirStateRank.Rank0
446
+ | AirStateRank.Rank1
447
+ | AirStateRank.Rank2
448
+ | AirStateRank.Rank3;
449
+
450
+ declare namespace AirState {
451
+ export type AirSupremacy = "AirSupremacy";
452
+ export type AirSuperiority = "AirSuperiority";
453
+ export type AirParity = "AirParity";
454
+ export type AirDenial = "AirDenial";
455
+ export type AirIncapability = "AirIncapability";
456
+ }
457
+
458
+ export type AirState =
459
+ | AirState.AirSupremacy
460
+ | AirState.AirSuperiority
461
+ | AirState.AirParity
462
+ | AirState.AirDenial
463
+ | AirState.AirIncapability;
430
464
 
431
465
  export interface NodeAttackAnalyzerShipConfig extends NightFleetConditions {
432
466
  formation?: Formation;
@@ -444,6 +478,13 @@ export interface NodeAttackAnalysis {
444
478
  right: AttackAnalysis;
445
479
  }
446
480
 
481
+ export interface ShipPosition {
482
+ org_type?: OrgType;
483
+ fleet_type?: FleetType;
484
+ fleet_len?: number;
485
+ index?: number;
486
+ }
487
+
447
488
  export interface CompMeta {
448
489
  fleets: Record<FleetType, FleetMeta>;
449
490
  }
@@ -545,34 +586,6 @@ declare namespace AswAttackType {
545
586
 
546
587
  export type AswAttackType = AswAttackType.DepthCharge | AswAttackType.Aircraft;
547
588
 
548
- declare namespace AirStateRank {
549
- export type Rank0 = "Rank0";
550
- export type Rank1 = "Rank1";
551
- export type Rank2 = "Rank2";
552
- export type Rank3 = "Rank3";
553
- }
554
-
555
- export type AirStateRank =
556
- | AirStateRank.Rank0
557
- | AirStateRank.Rank1
558
- | AirStateRank.Rank2
559
- | AirStateRank.Rank3;
560
-
561
- declare namespace AirState {
562
- export type AirSupremacy = "AirSupremacy";
563
- export type AirSuperiority = "AirSuperiority";
564
- export type AirParity = "AirParity";
565
- export type AirDenial = "AirDenial";
566
- export type AirIncapability = "AirIncapability";
567
- }
568
-
569
- export type AirState =
570
- | AirState.AirSupremacy
571
- | AirState.AirSuperiority
572
- | AirState.AirParity
573
- | AirState.AirDenial
574
- | AirState.AirIncapability;
575
-
576
589
  export interface MasterData {
577
590
  gears: MasterGear[];
578
591
  gear_attrs: MasterAttrRule<GearAttr>[];
@@ -599,107 +612,6 @@ export interface MasterAttrRule<T> {
599
612
  expr: string;
600
613
  }
601
614
 
602
- export interface AttackAnalyzerConfig {
603
- air_state?: AirState;
604
- engagement?: Engagement;
605
- attacker?: AttackAnalyzerShipConfig;
606
- target?: AttackAnalyzerShipConfig;
607
- }
608
-
609
- export interface AttackAnalyzerShipConfig
610
- extends ShipConditions,
611
- NightFleetConditions {
612
- fleet_los_mod?: number | null;
613
- }
614
-
615
- declare namespace ShipAttr {
616
- export type Unknown = "Unknown";
617
- export type Abyssal = "Abyssal";
618
- export type NightCarrier = "NightCarrier";
619
- export type Installation = "Installation";
620
- export type RoyalNavy = "RoyalNavy";
621
- export type Kai2 = "Kai2";
622
- export type TurbineSpeedBonus = "TurbineSpeedBonus";
623
- export type Pillbox = "Pillbox";
624
- export type IsolatedIsland = "IsolatedIsland";
625
- export type HarbourSummerPrincess = "HarbourSummerPrincess";
626
- export type SupplyDepot = "SupplyDepot";
627
- export type PtImp = "PtImp";
628
- export type BattleshipSummerPrincess = "BattleshipSummerPrincess";
629
- export type HeavyCruiserSummerPrincess = "HeavyCruiserSummerPrincess";
630
- }
631
-
632
- export type ShipAttr =
633
- | ShipAttr.Unknown
634
- | ShipAttr.Abyssal
635
- | ShipAttr.NightCarrier
636
- | ShipAttr.Installation
637
- | ShipAttr.RoyalNavy
638
- | ShipAttr.Kai2
639
- | ShipAttr.TurbineSpeedBonus
640
- | ShipAttr.Pillbox
641
- | ShipAttr.IsolatedIsland
642
- | ShipAttr.HarbourSummerPrincess
643
- | ShipAttr.SupplyDepot
644
- | ShipAttr.PtImp
645
- | ShipAttr.BattleshipSummerPrincess
646
- | ShipAttr.HeavyCruiserSummerPrincess;
647
-
648
- declare namespace OrgType {
649
- export type Single = "Single";
650
- export type CarrierTaskForce = "CarrierTaskForce";
651
- export type SurfaceTaskForce = "SurfaceTaskForce";
652
- export type TransportEscort = "TransportEscort";
653
- export type EnemySingle = "EnemySingle";
654
- export type EnemyCombined = "EnemyCombined";
655
- }
656
-
657
- export type OrgType =
658
- | OrgType.Single
659
- | OrgType.CarrierTaskForce
660
- | OrgType.SurfaceTaskForce
661
- | OrgType.TransportEscort
662
- | OrgType.EnemySingle
663
- | OrgType.EnemyCombined;
664
-
665
- export interface ShipEnvironment {
666
- org_type?: OrgType;
667
- role?: Role;
668
- index?: number;
669
- fleet_len?: number;
670
- formation?: Formation;
671
- fleet_los_mod?: number | null;
672
- night_conditions?: NightFleetConditions;
673
- }
674
-
675
- export interface NightFleetConditions {
676
- night_contact_rank?: ContactRank | null;
677
- starshell_index?: number | null;
678
- searchlight_index?: number | null;
679
- activates_large_searchlight?: boolean;
680
- }
681
-
682
- export interface NightConditions {
683
- player?: NightFleetConditions;
684
- enemy?: NightFleetConditions;
685
- }
686
-
687
- export interface BattleConditions {
688
- org_type: OrgType;
689
- role: Role;
690
- ship_index: number;
691
- fleet_len: number;
692
- formation: Formation;
693
- fleet_los_mod: number | null;
694
- night_conditions: NightFleetConditions;
695
- }
696
-
697
- export interface SupportShellingSimulatorParams {
698
- attacker_formation?: Formation;
699
- target_formation?: Formation;
700
- engagement: Engagement;
701
- }
702
-
703
615
  export interface EBonuses {
704
616
  firepower: number;
705
617
  torpedo: number;
@@ -740,12 +652,44 @@ export interface GearInput {
740
652
 
741
653
  export type GearVecInput = GearInput[];
742
654
 
743
- declare namespace Role {
744
- export type Main = "Main";
745
- export type Escort = "Escort";
655
+ declare namespace ShipAttr {
656
+ export type Unknown = "Unknown";
657
+ export type Abyssal = "Abyssal";
658
+ export type NightCarrier = "NightCarrier";
659
+ export type Installation = "Installation";
660
+ export type RoyalNavy = "RoyalNavy";
661
+ export type Kai2 = "Kai2";
662
+ export type TurbineSpeedBonus = "TurbineSpeedBonus";
663
+ export type Pillbox = "Pillbox";
664
+ export type IsolatedIsland = "IsolatedIsland";
665
+ export type HarbourSummerPrincess = "HarbourSummerPrincess";
666
+ export type SupplyDepot = "SupplyDepot";
667
+ export type PtImp = "PtImp";
668
+ export type BattleshipSummerPrincess = "BattleshipSummerPrincess";
669
+ export type HeavyCruiserSummerPrincess = "HeavyCruiserSummerPrincess";
746
670
  }
747
671
 
748
- export type Role = Role.Main | Role.Escort;
672
+ export type ShipAttr =
673
+ | ShipAttr.Unknown
674
+ | ShipAttr.Abyssal
675
+ | ShipAttr.NightCarrier
676
+ | ShipAttr.Installation
677
+ | ShipAttr.RoyalNavy
678
+ | ShipAttr.Kai2
679
+ | ShipAttr.TurbineSpeedBonus
680
+ | ShipAttr.Pillbox
681
+ | ShipAttr.IsolatedIsland
682
+ | ShipAttr.HarbourSummerPrincess
683
+ | ShipAttr.SupplyDepot
684
+ | ShipAttr.PtImp
685
+ | ShipAttr.BattleshipSummerPrincess
686
+ | ShipAttr.HeavyCruiserSummerPrincess;
687
+
688
+ export interface SupportShellingSimulatorParams {
689
+ attacker_formation?: Formation;
690
+ target_formation?: Formation;
691
+ engagement: Engagement;
692
+ }
749
693
 
750
694
  declare namespace GearAttr {
751
695
  export type Unknown = "Unknown";
@@ -927,6 +871,12 @@ export interface DamageReport {
927
871
  damage_state_density: Histogram<DamageState, number>;
928
872
  }
929
873
 
874
+ export interface AttackAnalyzerShipConfig
875
+ extends ShipConditions,
876
+ NightFleetConditions {
877
+ fleet_los_mod?: number | null;
878
+ }
879
+
930
880
  export interface CompAntiAirAnalysis {
931
881
  fleet_adjusted_anti_air: number;
932
882
  ships: AntiAirReport[];
@@ -986,6 +936,19 @@ export type SingleFormation =
986
936
  | SingleFormation.LineAbreast
987
937
  | SingleFormation.Vanguard;
988
938
 
939
+ declare namespace FleetType {
940
+ export type Main = "Main";
941
+ export type Escort = "Escort";
942
+ export type RouteSup = "RouteSup";
943
+ export type BossSup = "BossSup";
944
+ }
945
+
946
+ export type FleetType =
947
+ | FleetType.Main
948
+ | FleetType.Escort
949
+ | FleetType.RouteSup
950
+ | FleetType.BossSup;
951
+
989
952
  export interface CustomPowerModifiers {
990
953
  precap_mod?: AttackPowerModifier;
991
954
  postcap_mod?: AttackPowerModifier;
@@ -1125,6 +1088,28 @@ export interface AttackAnalysis {
1125
1088
  support_shelling: ActionReport<SupportShellingStyle>;
1126
1089
  }
1127
1090
 
1091
+ export interface NightFleetConditions {
1092
+ night_contact_rank?: ContactRank | null;
1093
+ starshell_index?: number | null;
1094
+ searchlight_index?: number | null;
1095
+ activates_large_searchlight?: boolean;
1096
+ }
1097
+
1098
+ export interface NightConditions {
1099
+ player?: NightFleetConditions;
1100
+ enemy?: NightFleetConditions;
1101
+ }
1102
+
1103
+ export interface BattleConditions {
1104
+ org_type: OrgType;
1105
+ role: Role;
1106
+ ship_index: number;
1107
+ fleet_len: number;
1108
+ formation: Formation;
1109
+ fleet_los_mod: number | null;
1110
+ night_conditions: NightFleetConditions;
1111
+ }
1112
+
1128
1113
  export interface MasterShip {
1129
1114
  ship_id: number;
1130
1115
  name: string;
@@ -1158,6 +1143,31 @@ export interface MasterShip {
1158
1143
 
1159
1144
  export type StatInterval = [number | null, number | null];
1160
1145
 
1146
+ export interface MasterGear {
1147
+ gear_id: number;
1148
+ name: string;
1149
+ types: GearTypeIdArray;
1150
+ special_type?: number;
1151
+ max_hp?: number;
1152
+ firepower?: number;
1153
+ armor?: number;
1154
+ torpedo?: number;
1155
+ anti_air?: number;
1156
+ speed?: number;
1157
+ bombing?: number;
1158
+ asw?: number;
1159
+ los?: number;
1160
+ luck?: number;
1161
+ accuracy?: number;
1162
+ evasion?: number;
1163
+ range?: number;
1164
+ radius?: number;
1165
+ cost?: number;
1166
+ improvable?: boolean;
1167
+ ship_anti_air_resist?: number;
1168
+ fleet_anti_air_resist?: number;
1169
+ }
1170
+
1161
1171
  export interface CompAnalyzerConfig {
1162
1172
  engagement: Engagement;
1163
1173
  formation: Formation;
@@ -1320,31 +1330,6 @@ export type SpeedGroup =
1320
1330
 
1321
1331
  export type SlotSizeVec = (number | null)[];
1322
1332
 
1323
- export interface MasterGear {
1324
- gear_id: number;
1325
- name: string;
1326
- types: GearTypeIdArray;
1327
- special_type?: number;
1328
- max_hp?: number;
1329
- firepower?: number;
1330
- armor?: number;
1331
- torpedo?: number;
1332
- anti_air?: number;
1333
- speed?: number;
1334
- bombing?: number;
1335
- asw?: number;
1336
- los?: number;
1337
- luck?: number;
1338
- accuracy?: number;
1339
- evasion?: number;
1340
- range?: number;
1341
- radius?: number;
1342
- cost?: number;
1343
- improvable?: boolean;
1344
- ship_anti_air_resist?: number;
1345
- fleet_anti_air_resist?: number;
1346
- }
1347
-
1348
1333
  export interface ActionReport<T> {
1349
1334
  data: Record<string, AttackReport<T>>;
1350
1335
  damage_state_density: Histogram<DamageState, number> | null;
@@ -1502,17 +1487,6 @@ export class AirSquadron {
1502
1487
  */
1503
1488
  export class Analyzer {
1504
1489
  free(): void;
1505
- /**
1506
- * @param {AttackAnalyzerConfig} config
1507
- * @param {Ship} attacker
1508
- * @param {Ship} target
1509
- * @returns {AttackAnalysis}
1510
- */
1511
- analyze_attack(
1512
- config: AttackAnalyzerConfig,
1513
- attacker: Ship,
1514
- target: Ship
1515
- ): AttackAnalysis;
1516
1490
  /**
1517
1491
  * @param {ShipAnalyzerConfig} config
1518
1492
  * @param {Ship} left
@@ -1520,7 +1494,7 @@ export class Analyzer {
1520
1494
  * @param {boolean} attacker_is_left
1521
1495
  * @returns {AttackAnalysis}
1522
1496
  */
1523
- analyze_attack_by_ship_analyzer(
1497
+ analyze_ship_attack(
1524
1498
  config: ShipAnalyzerConfig,
1525
1499
  left: Ship,
1526
1500
  right: Ship,
@@ -2026,7 +2000,7 @@ export class Gear {
2026
2000
  readonly ship_anti_air_resist: number;
2027
2001
  /**
2028
2002
  */
2029
- readonly special_type_id: number;
2003
+ readonly special_type: number;
2030
2004
  /**
2031
2005
  */
2032
2006
  readonly speed: number;
@@ -122,6 +122,21 @@ module.exports.parse_ship_conditions = function(value) {
122
122
  return takeObject(ret);
123
123
  };
124
124
 
125
+ const u32CvtShim = new Uint32Array(2);
126
+
127
+ const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
128
+
129
+ function getArrayU8FromWasm0(ptr, len) {
130
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
131
+ }
132
+
133
+ function passArray8ToWasm0(arg, malloc) {
134
+ const ptr = malloc(arg.length * 1);
135
+ getUint8Memory0().set(arg, ptr / 1);
136
+ WASM_VECTOR_LEN = arg.length;
137
+ return ptr;
138
+ }
139
+
125
140
  function _assertClass(instance, klass) {
126
141
  if (!(instance instanceof klass)) {
127
142
  throw new Error(`expected instance of ${klass.name}`);
@@ -129,10 +144,6 @@ function _assertClass(instance, klass) {
129
144
  return instance.ptr;
130
145
  }
131
146
 
132
- const u32CvtShim = new Uint32Array(2);
133
-
134
- const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
135
-
136
147
  let cachedFloat64Memory0 = new Float64Array();
137
148
 
138
149
  function getFloat64Memory0() {
@@ -142,17 +153,6 @@ function getFloat64Memory0() {
142
153
  return cachedFloat64Memory0;
143
154
  }
144
155
 
145
- function getArrayU8FromWasm0(ptr, len) {
146
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
147
- }
148
-
149
- function passArray8ToWasm0(arg, malloc) {
150
- const ptr = malloc(arg.length * 1);
151
- getUint8Memory0().set(arg, ptr / 1);
152
- WASM_VECTOR_LEN = arg.length;
153
- return ptr;
154
- }
155
-
156
156
  function isLikeNone(x) {
157
157
  return x === undefined || x === null;
158
158
  }
@@ -391,28 +391,16 @@ class Analyzer {
391
391
  wasm.__wbg_analyzer_free(ptr);
392
392
  }
393
393
  /**
394
- * @param {AttackAnalyzerConfig} config
395
- * @param {Ship} attacker
396
- * @param {Ship} target
397
- * @returns {AttackAnalysis}
398
- */
399
- analyze_attack(config, attacker, target) {
400
- _assertClass(attacker, Ship);
401
- _assertClass(target, Ship);
402
- const ret = wasm.analyzer_analyze_attack(this.ptr, addHeapObject(config), attacker.ptr, target.ptr);
403
- return takeObject(ret);
404
- }
405
- /**
406
394
  * @param {ShipAnalyzerConfig} config
407
395
  * @param {Ship} left
408
396
  * @param {Ship} right
409
397
  * @param {boolean} attacker_is_left
410
398
  * @returns {AttackAnalysis}
411
399
  */
412
- analyze_attack_by_ship_analyzer(config, left, right, attacker_is_left) {
400
+ analyze_ship_attack(config, left, right, attacker_is_left) {
413
401
  _assertClass(left, Ship);
414
402
  _assertClass(right, Ship);
415
- const ret = wasm.analyzer_analyze_attack_by_ship_analyzer(this.ptr, addHeapObject(config), left.ptr, right.ptr, attacker_is_left);
403
+ const ret = wasm.analyzer_analyze_ship_attack(this.ptr, addHeapObject(config), left.ptr, right.ptr, attacker_is_left);
416
404
  return takeObject(ret);
417
405
  }
418
406
  /**
@@ -1455,8 +1443,8 @@ class Gear {
1455
1443
  /**
1456
1444
  * @returns {number}
1457
1445
  */
1458
- get special_type_id() {
1459
- const ret = wasm.gear_special_type_id(this.ptr);
1446
+ get special_type() {
1447
+ const ret = wasm.gear_special_type(this.ptr);
1460
1448
  return ret;
1461
1449
  }
1462
1450
  /**
@@ -3149,7 +3137,7 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
3149
3137
  return addHeapObject(ret);
3150
3138
  };
3151
3139
 
3152
- module.exports.__wbg_createEquipmentBonuses_6bfec5b900d74071 = function(arg0, arg1) {
3140
+ module.exports.__wbg_createEquipmentBonuses_d215617bb16aa6f4 = function(arg0, arg1) {
3153
3141
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3154
3142
  return addHeapObject(ret);
3155
3143
  };
Binary file