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.
@@ -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;
16
12
  function getUint8Memory0() {
@@ -20,6 +16,41 @@ function getUint8Memory0() {
20
16
  return cachedUint8Memory0;
21
17
  }
22
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
+
23
54
  let cachedTextEncoder = new TextEncoder('utf-8');
24
55
 
25
56
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -81,37 +112,6 @@ function getInt32Memory0() {
81
112
  return cachedInt32Memory0;
82
113
  }
83
114
 
84
- let heap_next = heap.length;
85
-
86
- function dropObject(idx) {
87
- if (idx < 36) return;
88
- heap[idx] = heap_next;
89
- heap_next = idx;
90
- }
91
-
92
- function takeObject(idx) {
93
- const ret = getObject(idx);
94
- dropObject(idx);
95
- return ret;
96
- }
97
-
98
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
99
-
100
- cachedTextDecoder.decode();
101
-
102
- function getStringFromWasm0(ptr, len) {
103
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
104
- }
105
-
106
- function addHeapObject(obj) {
107
- if (heap_next === heap.length) heap.push(heap.length + 1);
108
- const idx = heap_next;
109
- heap_next = heap[idx];
110
-
111
- heap[idx] = obj;
112
- return idx;
113
- }
114
-
115
115
  const u32CvtShim = new Uint32Array(2);
116
116
 
117
117
  const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
@@ -916,7 +916,7 @@ class Fleet {
916
916
  get xxh3() {
917
917
  try {
918
918
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
919
- wasm.__wbg_get_airsquadron_xxh3(retptr, this.ptr);
919
+ wasm.__wbg_get_fleet_xxh3(retptr, this.ptr);
920
920
  var r0 = getInt32Memory0()[retptr / 4 + 0];
921
921
  var r1 = getInt32Memory0()[retptr / 4 + 1];
922
922
  u32CvtShim[0] = r0;
@@ -933,7 +933,7 @@ class Fleet {
933
933
  uint64CvtShim[0] = arg0;
934
934
  const low0 = u32CvtShim[0];
935
935
  const high0 = u32CvtShim[1];
936
- wasm.__wbg_set_airsquadron_xxh3(this.ptr, low0, high0);
936
+ wasm.__wbg_set_fleet_xxh3(this.ptr, low0, high0);
937
937
  }
938
938
  /**
939
939
  */
@@ -2662,6 +2662,13 @@ class Ship {
2662
2662
  return takeObject(ret);
2663
2663
  }
2664
2664
  /**
2665
+ * @returns {CustomPowerModifiers}
2666
+ */
2667
+ custom_power_mods() {
2668
+ const ret = wasm.ship_custom_power_mods(this.ptr);
2669
+ return takeObject(ret);
2670
+ }
2671
+ /**
2665
2672
  * @returns {ShipMeta}
2666
2673
  */
2667
2674
  meta() {
@@ -3042,14 +3049,6 @@ class Ship {
3042
3049
  return ret;
3043
3050
  }
3044
3051
  /**
3045
- * @param {boolean} is_night
3046
- * @returns {number}
3047
- */
3048
- fit_gun_bonus(is_night) {
3049
- const ret = wasm.ship_fit_gun_bonus(this.ptr, is_night);
3050
- return ret;
3051
- }
3052
- /**
3053
3052
  * @returns {number | undefined}
3054
3053
  */
3055
3054
  basic_accuracy_term() {
@@ -3152,9 +3151,55 @@ class Ship {
3152
3151
  take_damage(value) {
3153
3152
  wasm.ship_take_damage(this.ptr, value);
3154
3153
  }
3154
+ /**
3155
+ * @returns {number | undefined}
3156
+ */
3157
+ state_day_gunfit_accuracy() {
3158
+ try {
3159
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3160
+ wasm.ship_state_day_gunfit_accuracy(retptr, this.ptr);
3161
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
3162
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3163
+ return r0 === 0 ? undefined : r2;
3164
+ } finally {
3165
+ wasm.__wbindgen_add_to_stack_pointer(16);
3166
+ }
3167
+ }
3168
+ /**
3169
+ * @returns {number | undefined}
3170
+ */
3171
+ state_night_gunfit_accuracy() {
3172
+ try {
3173
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3174
+ wasm.ship_state_night_gunfit_accuracy(retptr, this.ptr);
3175
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
3176
+ var r2 = getFloat64Memory0()[retptr / 8 + 1];
3177
+ return r0 === 0 ? undefined : r2;
3178
+ } finally {
3179
+ wasm.__wbindgen_add_to_stack_pointer(16);
3180
+ }
3181
+ }
3182
+ /**
3183
+ * フィット砲補正
3184
+ * @param {boolean} is_night
3185
+ * @returns {number}
3186
+ */
3187
+ gunfit_accuracy(is_night) {
3188
+ const ret = wasm.ship_gunfit_accuracy(this.ptr, is_night);
3189
+ return ret;
3190
+ }
3155
3191
  }
3156
3192
  module.exports.Ship = Ship;
3157
3193
 
3194
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
3195
+ const ret = getStringFromWasm0(arg0, arg1);
3196
+ return addHeapObject(ret);
3197
+ };
3198
+
3199
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
3200
+ takeObject(arg0);
3201
+ };
3202
+
3158
3203
  module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
3159
3204
  const obj = getObject(arg1);
3160
3205
  const ret = JSON.stringify(obj === undefined ? null : obj);
@@ -3164,25 +3209,16 @@ module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
3164
3209
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3165
3210
  };
3166
3211
 
3167
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
3168
- takeObject(arg0);
3169
- };
3170
-
3171
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
3172
- const ret = getStringFromWasm0(arg0, arg1);
3212
+ module.exports.__wbg_ship_new = function(arg0) {
3213
+ const ret = Ship.__wrap(arg0);
3173
3214
  return addHeapObject(ret);
3174
3215
  };
3175
3216
 
3176
- module.exports.__wbg_createEquipmentBonuses_184e78e66b9cdc65 = function(arg0, arg1) {
3217
+ module.exports.__wbg_createEquipmentBonuses_58230833abcc8ac8 = function(arg0, arg1) {
3177
3218
  const ret = createEquipmentBonuses(takeObject(arg0), takeObject(arg1));
3178
3219
  return addHeapObject(ret);
3179
3220
  };
3180
3221
 
3181
- module.exports.__wbg_ship_new = function(arg0) {
3182
- const ret = Ship.__wrap(arg0);
3183
- return addHeapObject(ret);
3184
- };
3185
-
3186
3222
  module.exports.__wbindgen_json_parse = function(arg0, arg1) {
3187
3223
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
3188
3224
  return addHeapObject(ret);
@@ -3209,14 +3245,6 @@ module.exports.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
3209
3245
  }
3210
3246
  };
3211
3247
 
3212
- module.exports.__wbg_randomFillSync_91e2b39becca6147 = function() { return handleError(function (arg0, arg1, arg2) {
3213
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3214
- }, arguments) };
3215
-
3216
- module.exports.__wbg_getRandomValues_b14734aa289bc356 = function() { return handleError(function (arg0, arg1) {
3217
- getObject(arg0).getRandomValues(getObject(arg1));
3218
- }, arguments) };
3219
-
3220
3248
  module.exports.__wbg_process_e56fd54cf6319b6c = function(arg0) {
3221
3249
  const ret = getObject(arg0).process;
3222
3250
  return addHeapObject(ret);
@@ -3263,6 +3291,14 @@ module.exports.__wbg_msCrypto_5a86d77a66230f81 = function(arg0) {
3263
3291
  return addHeapObject(ret);
3264
3292
  };
3265
3293
 
3294
+ module.exports.__wbg_getRandomValues_b14734aa289bc356 = function() { return handleError(function (arg0, arg1) {
3295
+ getObject(arg0).getRandomValues(getObject(arg1));
3296
+ }, arguments) };
3297
+
3298
+ module.exports.__wbg_randomFillSync_91e2b39becca6147 = function() { return handleError(function (arg0, arg1, arg2) {
3299
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
3300
+ }, arguments) };
3301
+
3266
3302
  module.exports.__wbg_new_2ab697f1555e0dbc = function() {
3267
3303
  const ret = new Array();
3268
3304
  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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleethub-core",
3
- "version": "1.7.2",
3
+ "version": "1.7.6",
4
4
  "license": "UNLICENSED",
5
5
  "sideEffects": false,
6
6
  "exports": {