deepwoken 0.1.7 → 0.1.9

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/index.ts CHANGED
@@ -55,6 +55,11 @@ export class StatMap {
55
55
 
56
56
  /* The total build cost, accounting for multi-attunement shenanigans */
57
57
  cost(): number { return this._wasm.cost(); }
58
+ /* The points remaining available to invest */
59
+ remaining(): number { return this._wasm.remaining(); }
60
+ /* The level the character is at */
61
+ level(): number { return this._wasm.level(); }
62
+
58
63
  get(stat: Stat): number { return this._wasm.get(stat); }
59
64
  set(stat: Stat, value: number) { this._wasm.set(stat, value); }
60
65
  toJSON(): Partial<Record<Stat, number>> { return this._wasm.toJSON(); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepwoken",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -34,11 +34,16 @@ export class StatMap {
34
34
  [Symbol.dispose](): void;
35
35
  cost(): number;
36
36
  get(stat: string): number;
37
+ level(): number;
37
38
  constructor(map: any);
39
+ remaining(): number;
38
40
  set(stat: string, value: number): void;
41
+ shrineOrder(racial: StatMap): StatMap;
39
42
  toJSON(): any;
40
43
  }
41
44
 
45
+ export function shrineOrderDwb(pre: StatMap, racial: StatMap): StatMap;
46
+
42
47
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
43
48
 
44
49
  export interface InitOutput {
@@ -58,16 +63,20 @@ export interface InitOutput {
58
63
  readonly deepdata_outfits: (a: number) => [number, number, number];
59
64
  readonly deepdata_talents: (a: number) => [number, number, number];
60
65
  readonly deepdata_weapons: (a: number) => [number, number, number];
66
+ readonly shrineOrderDwb: (a: number, b: number) => number;
61
67
  readonly statmap_cost: (a: number) => number;
62
68
  readonly statmap_get: (a: number, b: number, c: number) => [number, number, number];
69
+ readonly statmap_level: (a: number) => number;
63
70
  readonly statmap_new: (a: any) => [number, number, number];
71
+ readonly statmap_remaining: (a: number) => number;
64
72
  readonly statmap_set: (a: number, b: number, c: number, d: number) => [number, number];
65
73
  readonly statmap_toJSON: (a: number) => [number, number, number];
66
- readonly wasm_bindgen__closure__destroy__hf10da1d08ed9fc18: (a: number, b: number) => void;
67
- readonly wasm_bindgen__closure__destroy__he46194fcf4899997: (a: number, b: number) => void;
68
- readonly wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15: (a: number, b: number, c: any) => [number, number];
69
- readonly wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735: (a: number, b: number, c: any, d: any) => void;
70
- readonly wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8: (a: number, b: number) => void;
74
+ readonly statmap_shrineOrder: (a: number, b: number) => number;
75
+ readonly wasm_bindgen__closure__destroy__hfbac65673247baa3: (a: number, b: number) => void;
76
+ readonly wasm_bindgen__closure__destroy__h22f2fd8de233cef9: (a: number, b: number) => void;
77
+ readonly wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1: (a: number, b: number, c: any) => [number, number];
78
+ readonly wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b: (a: number, b: number, c: any, d: any) => void;
79
+ readonly wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639: (a: number, b: number) => void;
71
80
  readonly __wbindgen_malloc: (a: number, b: number) => number;
72
81
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
73
82
  readonly __wbindgen_exn_store: (a: number) => void;
package/pkg/deepwoken.js CHANGED
@@ -173,6 +173,13 @@ export class DeepData {
173
173
  if (Symbol.dispose) DeepData.prototype[Symbol.dispose] = DeepData.prototype.free;
174
174
 
175
175
  export class StatMap {
176
+ static __wrap(ptr) {
177
+ ptr = ptr >>> 0;
178
+ const obj = Object.create(StatMap.prototype);
179
+ obj.__wbg_ptr = ptr;
180
+ StatMapFinalization.register(obj, obj.__wbg_ptr, obj);
181
+ return obj;
182
+ }
176
183
  __destroy_into_raw() {
177
184
  const ptr = this.__wbg_ptr;
178
185
  this.__wbg_ptr = 0;
@@ -203,6 +210,13 @@ export class StatMap {
203
210
  }
204
211
  return ret[0];
205
212
  }
213
+ /**
214
+ * @returns {number}
215
+ */
216
+ level() {
217
+ const ret = wasm.statmap_level(this.__wbg_ptr);
218
+ return ret;
219
+ }
206
220
  /**
207
221
  * @param {any} map
208
222
  */
@@ -215,6 +229,13 @@ export class StatMap {
215
229
  StatMapFinalization.register(this, this.__wbg_ptr, this);
216
230
  return this;
217
231
  }
232
+ /**
233
+ * @returns {number}
234
+ */
235
+ remaining() {
236
+ const ret = wasm.statmap_remaining(this.__wbg_ptr);
237
+ return ret;
238
+ }
218
239
  /**
219
240
  * @param {string} stat
220
241
  * @param {number} value
@@ -227,6 +248,15 @@ export class StatMap {
227
248
  throw takeFromExternrefTable0(ret[0]);
228
249
  }
229
250
  }
251
+ /**
252
+ * @param {StatMap} racial
253
+ * @returns {StatMap}
254
+ */
255
+ shrineOrder(racial) {
256
+ _assertClass(racial, StatMap);
257
+ const ret = wasm.statmap_shrineOrder(this.__wbg_ptr, racial.__wbg_ptr);
258
+ return StatMap.__wrap(ret);
259
+ }
230
260
  /**
231
261
  * @returns {any}
232
262
  */
@@ -240,6 +270,18 @@ export class StatMap {
240
270
  }
241
271
  if (Symbol.dispose) StatMap.prototype[Symbol.dispose] = StatMap.prototype.free;
242
272
 
273
+ /**
274
+ * @param {StatMap} pre
275
+ * @param {StatMap} racial
276
+ * @returns {StatMap}
277
+ */
278
+ export function shrineOrderDwb(pre, racial) {
279
+ _assertClass(pre, StatMap);
280
+ _assertClass(racial, StatMap);
281
+ const ret = wasm.shrineOrderDwb(pre.__wbg_ptr, racial.__wbg_ptr);
282
+ return StatMap.__wrap(ret);
283
+ }
284
+
243
285
  function __wbg_get_imports() {
244
286
  const import0 = {
245
287
  __proto__: null,
@@ -471,7 +513,7 @@ function __wbg_get_imports() {
471
513
  const a = state0.a;
472
514
  state0.a = 0;
473
515
  try {
474
- return wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(a, state0.b, arg0, arg1);
516
+ return wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b(a, state0.b, arg0, arg1);
475
517
  } finally {
476
518
  state0.a = a;
477
519
  }
@@ -595,13 +637,13 @@ function __wbg_get_imports() {
595
637
  return ret;
596
638
  },
597
639
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
598
- // Cast intrinsic for `Closure(Closure { dtor_idx: 145, function: Function { arguments: [], shim_idx: 146, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
599
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf10da1d08ed9fc18, wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8);
640
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 147, function: Function { arguments: [], shim_idx: 148, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
641
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfbac65673247baa3, wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639);
600
642
  return ret;
601
643
  },
602
644
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
603
- // Cast intrinsic for `Closure(Closure { dtor_idx: 169, function: Function { arguments: [Externref], shim_idx: 170, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
604
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he46194fcf4899997, wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15);
645
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 167, function: Function { arguments: [Externref], shim_idx: 168, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
646
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h22f2fd8de233cef9, wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1);
605
647
  return ret;
606
648
  },
607
649
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -635,19 +677,19 @@ function __wbg_get_imports() {
635
677
  };
636
678
  }
637
679
 
638
- function wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8(arg0, arg1) {
639
- wasm.wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8(arg0, arg1);
680
+ function wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639(arg0, arg1) {
681
+ wasm.wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639(arg0, arg1);
640
682
  }
641
683
 
642
- function wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15(arg0, arg1, arg2) {
643
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15(arg0, arg1, arg2);
684
+ function wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1(arg0, arg1, arg2) {
685
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1(arg0, arg1, arg2);
644
686
  if (ret[1]) {
645
687
  throw takeFromExternrefTable0(ret[0]);
646
688
  }
647
689
  }
648
690
 
649
- function wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(arg0, arg1, arg2, arg3) {
650
- wasm.wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(arg0, arg1, arg2, arg3);
691
+ function wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b(arg0, arg1, arg2, arg3) {
692
+ wasm.wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b(arg0, arg1, arg2, arg3);
651
693
  }
652
694
 
653
695
 
@@ -671,6 +713,12 @@ function addToExternrefTable0(obj) {
671
713
  return idx;
672
714
  }
673
715
 
716
+ function _assertClass(instance, klass) {
717
+ if (!(instance instanceof klass)) {
718
+ throw new Error(`expected instance of ${klass.name}`);
719
+ }
720
+ }
721
+
674
722
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
675
723
  ? { register: () => {}, unregister: () => {} }
676
724
  : new FinalizationRegistry(state => state.dtor(state.a, state.b));
Binary file