fleethub-core 1.7.2 → 1.7.6

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;
13
11
  function getUint8Memory0() {
@@ -17,6 +15,41 @@ function getUint8Memory0() {
17
15
  return cachedUint8Memory0;
18
16
  }
19
17
 
18
+ function getStringFromWasm0(ptr, len) {
19
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
20
+ }
21
+
22
+ const heap = new Array(32).fill(undefined);
23
+
24
+ heap.push(undefined, null, true, false);
25
+
26
+ let heap_next = heap.length;
27
+
28
+ function addHeapObject(obj) {
29
+ if (heap_next === heap.length) heap.push(heap.length + 1);
30
+ const idx = heap_next;
31
+ heap_next = heap[idx];
32
+
33
+ heap[idx] = obj;
34
+ return idx;
35
+ }
36
+
37
+ function getObject(idx) { return heap[idx]; }
38
+
39
+ function dropObject(idx) {
40
+ if (idx < 36) return;
41
+ heap[idx] = heap_next;
42
+ heap_next = idx;
43
+ }
44
+
45
+ function takeObject(idx) {
46
+ const ret = getObject(idx);
47
+ dropObject(idx);
48
+ return ret;
49
+ }
50
+
51
+ let WASM_VECTOR_LEN = 0;
52
+
20
53
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
21
54
 
22
55
  let cachedTextEncoder = new lTextEncoder('utf-8');
@@ -80,39 +113,6 @@ function getInt32Memory0() {
80
113
  return cachedInt32Memory0;
81
114
  }
82
115
 
83
- let heap_next = heap.length;
84
-
85
- function dropObject(idx) {
86
- if (idx < 36) return;
87
- heap[idx] = heap_next;
88
- heap_next = idx;
89
- }
90
-
91
- function takeObject(idx) {
92
- const ret = getObject(idx);
93
- dropObject(idx);
94
- return ret;
95
- }
96
-
97
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
98
-
99
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
100
-
101
- cachedTextDecoder.decode();
102
-
103
- function getStringFromWasm0(ptr, len) {
104
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
105
- }
106
-
107
- function addHeapObject(obj) {
108
- if (heap_next === heap.length) heap.push(heap.length + 1);
109
- const idx = heap_next;
110
- heap_next = heap[idx];
111
-
112
- heap[idx] = obj;
113
- return idx;
114
- }
115
-
116
116
  const u32CvtShim = new Uint32Array(2);
117
117
 
118
118
  const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
@@ -913,7 +913,7 @@ export class Fleet {
913
913
  get xxh3() {
914
914
  try {
915
915
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
916
- wasm.__wbg_get_airsquadron_xxh3(retptr, this.ptr);
916
+ wasm.__wbg_get_fleet_xxh3(retptr, this.ptr);
917
917
  var r0 = getInt32Memory0()[retptr / 4 + 0];
918
918
  var r1 = getInt32Memory0()[retptr / 4 + 1];
919
919
  u32CvtShim[0] = r0;
@@ -930,7 +930,7 @@ export class Fleet {
930
930
  uint64CvtShim[0] = arg0;
931
931
  const low0 = u32CvtShim[0];
932
932
  const high0 = u32CvtShim[1];
933
- wasm.__wbg_set_airsquadron_xxh3(this.ptr, low0, high0);
933
+ wasm.__wbg_set_fleet_xxh3(this.ptr, low0, high0);
934
934
  }
935
935
  /**
936
936
  */
@@ -2655,6 +2655,13 @@ export class Ship {
2655
2655
  return takeObject(ret);
2656
2656
  }
2657
2657
  /**
2658
+ * @returns {CustomPowerModifiers}
2659
+ */
2660
+ custom_power_mods() {
2661
+ const ret = wasm.ship_custom_power_mods(this.ptr);
2662
+ return takeObject(ret);
2663
+ }
2664
+ /**
2658
2665
  * @returns {ShipMeta}
2659
2666
  */
2660
2667
  meta() {
@@ -3035,14 +3042,6 @@ export class Ship {
3035
3042
  return ret;
3036
3043
  }
3037
3044
  /**
3038
- * @param {boolean} is_night
3039
- * @returns {number}
3040
- */
3041
- fit_gun_bonus(is_night) {
3042
- const ret = wasm.ship_fit_gun_bonus(this.ptr, is_night);
3043
- return ret;
3044
- }
3045
- /**
3046
3045
  * @returns {number | undefined}
3047
3046
  */
3048
3047
  basic_accuracy_term() {
@@ -3145,8 +3144,54 @@ export class Ship {
3145
3144
  take_damage(value) {
3146
3145
  wasm.ship_take_damage(this.ptr, value);
3147
3146
  }
3147
+ /**
3148
+ * @returns {number | undefined}
3149
+ */
3150
+ state_day_gunfit_accuracy() {
3151
+ try {
3152
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3153
+ wasm.ship_state_day_gunfit_accuracy(retptr, this.ptr);
3154
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
3155
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3156
+ return r0 === 0 ? undefined : r2;
3157
+ } finally {
3158
+ wasm.__wbindgen_add_to_stack_pointer(16);
3159
+ }
3160
+ }
3161
+ /**
3162
+ * @returns {number | undefined}
3163
+ */
3164
+ state_night_gunfit_accuracy() {
3165
+ try {
3166
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3167
+ wasm.ship_state_night_gunfit_accuracy(retptr, this.ptr);
3168
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
3169
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3170
+ return r0 === 0 ? undefined : r2;
3171
+ } finally {
3172
+ wasm.__wbindgen_add_to_stack_pointer(16);
3173
+ }
3174
+ }
3175
+ /**
3176
+ * フィット砲補正
3177
+ * @param {boolean} is_night
3178
+ * @returns {number}
3179
+ */
3180
+ gunfit_accuracy(is_night) {
3181
+ const ret = wasm.ship_gunfit_accuracy(this.ptr, is_night);
3182
+ return ret;
3183
+ }
3148
3184
  }
3149
3185
 
3186
+ export function __wbindgen_string_new(arg0, arg1) {
3187
+ const ret = getStringFromWasm0(arg0, arg1);
3188
+ return addHeapObject(ret);
3189
+ };
3190
+
3191
+ export function __wbindgen_object_drop_ref(arg0) {
3192
+ takeObject(arg0);
3193
+ };
3194
+
3150
3195
  export function __wbindgen_json_serialize(arg0, arg1) {
3151
3196
  const obj = getObject(arg1);
3152
3197
  const ret = JSON.stringify(obj === undefined ? null : obj);
@@ -3156,25 +3201,16 @@ export function __wbindgen_json_serialize(arg0, arg1) {
3156
3201
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3157
3202
  };
3158
3203
 
3159
- export function __wbindgen_object_drop_ref(arg0) {
3160
- takeObject(arg0);
3161
- };
3162
-
3163
- export function __wbindgen_string_new(arg0, arg1) {
3164
- const ret = getStringFromWasm0(arg0, arg1);
3204
+ export function __wbg_ship_new(arg0) {
3205
+ const ret = Ship.__wrap(arg0);
3165
3206
  return addHeapObject(ret);
3166
3207
  };
3167
3208
 
3168
- export function __wbg_createEquipmentBonuses_184e78e66b9cdc65(arg0, arg1) {
3209
+ export function __wbg_createEquipmentBonuses_58230833abcc8ac8(arg0, arg1) {
3169
3210
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3170
3211
  return addHeapObject(ret);
3171
3212
  };
3172
3213
 
3173
- export function __wbg_ship_new(arg0) {
3174
- const ret = Ship.__wrap(arg0);
3175
- return addHeapObject(ret);
3176
- };
3177
-
3178
3214
  export function __wbindgen_json_parse(arg0, arg1) {
3179
3215
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3180
3216
  return addHeapObject(ret);
@@ -3201,14 +3237,6 @@ export function __wbg_error_09919627ac0992f5(arg0, arg1) {
3201
3237
  }
3202
3238
  };
3203
3239
 
3204
- export function __wbg_randomFillSync_91e2b39becca6147() { return handleError(function (arg0, arg1, arg2) {
3205
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3206
- }, arguments) };
3207
-
3208
- export function __wbg_getRandomValues_b14734aa289bc356() { return handleError(function (arg0, arg1) {
3209
- getObject(arg0).getRandomValues(getObject(arg1));
3210
- }, arguments) };
3211
-
3212
3240
  export function __wbg_process_e56fd54cf6319b6c(arg0) {
3213
3241
  const ret = getObject(arg0).process;
3214
3242
  return addHeapObject(ret);
@@ -3255,6 +3283,14 @@ export function __wbg_msCrypto_5a86d77a66230f81(arg0) {
3255
3283
  return addHeapObject(ret);
3256
3284
  };
3257
3285
 
3286
+ export function __wbg_getRandomValues_b14734aa289bc356() { return handleError(function (arg0, arg1) {
3287
+ getObject(arg0).getRandomValues(getObject(arg1));
3288
+ }, arguments) };
3289
+
3290
+ export function __wbg_randomFillSync_91e2b39becca6147() { return handleError(function (arg0, arg1, arg2) {
3291
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3292
+ }, arguments) };
3293
+
3258
3294
  export function __wbg_new_2ab697f1555e0dbc() {
3259
3295
  const ret = new Array();
3260
3296
  return addHeapObject(ret);
Binary file
@@ -41,6 +41,7 @@ export function ship_los(a: number): number;
41
41
  export function ship_default(): number;
42
42
  export function ship_eq_id(a: number, b: number, c: number): number;
43
43
  export function ship_state(a: number): number;
44
+ export function ship_custom_power_mods(a: number): number;
44
45
  export function ship_meta(a: number): number;
45
46
  export function ship_name(a: number, b: number): void;
46
47
  export function ship_yomi(a: number, b: number): void;
@@ -88,7 +89,6 @@ export function ship_fighter_power(a: number, b: number, c: number): void;
88
89
  export function ship_fleet_los_factor(a: number, b: number): void;
89
90
  export function ship_fleet_anti_air_mod(a: number): number;
90
91
  export function ship_cruiser_fit_bonus(a: number): number;
91
- export function ship_fit_gun_bonus(a: number, b: number): number;
92
92
  export function ship_basic_accuracy_term(a: number, b: number): void;
93
93
  export function ship_basic_evasion_term(a: number, b: number): void;
94
94
  export function ship_evasion_term(a: number, b: number, c: number, d: number, e: number): void;
@@ -187,6 +187,8 @@ export function airsquadron_radius(a: number): number;
187
187
  export function __wbg_fleet_free(a: number): void;
188
188
  export function __wbg_get_fleet_id(a: number, b: number): void;
189
189
  export function __wbg_set_fleet_id(a: number, b: number, c: number): void;
190
+ export function __wbg_get_fleet_xxh3(a: number, b: number): void;
191
+ export function __wbg_set_fleet_xxh3(a: number, b: number, c: number): void;
190
192
  export function __wbg_get_fleet_len(a: number): number;
191
193
  export function __wbg_set_fleet_len(a: number, b: number): void;
192
194
  export function fleet_meta(a: number): number;
@@ -206,8 +208,6 @@ export function fleet_aviation_detection_score(a: number, b: number): void;
206
208
  export function fleet_expedition_bonus(a: number): number;
207
209
  export function fleet_sum_ship_stat_by(a: number, b: number, c: number, d: number): void;
208
210
  export function fleet_reset_battle_state(a: number): void;
209
- export function __wbg_get_fleet_xxh3(a: number, b: number): void;
210
- export function __wbg_set_fleet_xxh3(a: number, b: number, c: number): void;
211
211
  export function __wbg_fhcore_free(a: number): void;
212
212
  export function fhcore_new(a: number, b: number): void;
213
213
  export function fhcore_create_gear(a: number, b: number): number;
@@ -222,6 +222,9 @@ export function fhcore_create_default_ship(a: number): number;
222
222
  export function fhcore_create_analyzer(a: number): number;
223
223
  export function fhcore_simulate_shelling_support(a: number, b: number, c: number, d: number, e: number, f: number): void;
224
224
  export function set_panic_hook(): void;
225
+ export function ship_state_day_gunfit_accuracy(a: number, b: number): void;
226
+ export function ship_state_night_gunfit_accuracy(a: number, b: number): void;
227
+ export function ship_gunfit_accuracy(a: number, b: number): number;
225
228
  export function __wbg_ibonuses_free(a: number): void;
226
229
  export function __wbg_get_ibonuses_shelling_power(a: number): number;
227
230
  export function __wbg_set_ibonuses_shelling_power(a: number, b: number): void;