mons-web 0.1.112 → 0.1.114

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/mons-web.d.ts CHANGED
@@ -10,16 +10,11 @@
10
10
  export function winner(fen_w: string, fen_b: string, flat_moves_string_w: string, flat_moves_string_b: string): string;
11
11
  /**
12
12
  */
13
- export enum Consumable {
14
- Potion = 0,
15
- Bomb = 1,
16
- BombOrPotion = 2,
17
- }
18
- /**
19
- */
20
- export enum ManaKind {
21
- Regular = 0,
22
- Supermana = 1,
13
+ export enum OutputModelKind {
14
+ InvalidInput = 0,
15
+ LocationsToStartFrom = 1,
16
+ NextInputOptions = 2,
17
+ Events = 3,
23
18
  }
24
19
  /**
25
20
  */
@@ -30,25 +25,16 @@ export enum Modifier {
30
25
  }
31
26
  /**
32
27
  */
33
- export enum NextInputKind {
34
- MonMove = 0,
35
- ManaMove = 1,
36
- MysticAction = 2,
37
- DemonAction = 3,
38
- DemonAdditionalStep = 4,
39
- SpiritTargetCapture = 5,
40
- SpiritTargetMove = 6,
41
- SelectConsumable = 7,
42
- BombAttack = 8,
28
+ export enum Color {
29
+ White = 0,
30
+ Black = 1,
43
31
  }
44
32
  /**
45
33
  */
46
- export enum ItemModelKind {
47
- Mon = 0,
48
- Mana = 1,
49
- MonWithMana = 2,
50
- MonWithConsumable = 3,
51
- Consumable = 4,
34
+ export enum Consumable {
35
+ Potion = 0,
36
+ Bomb = 1,
37
+ BombOrPotion = 2,
52
38
  }
53
39
  /**
54
40
  */
@@ -61,12 +47,6 @@ export enum MonKind {
61
47
  }
62
48
  /**
63
49
  */
64
- export enum Color {
65
- White = 0,
66
- Black = 1,
67
- }
68
- /**
69
- */
70
50
  export enum SquareModelKind {
71
51
  Regular = 0,
72
52
  ConsumableBase = 1,
@@ -77,6 +57,25 @@ export enum SquareModelKind {
77
57
  }
78
58
  /**
79
59
  */
60
+ export enum ManaKind {
61
+ Regular = 0,
62
+ Supermana = 1,
63
+ }
64
+ /**
65
+ */
66
+ export enum NextInputKind {
67
+ MonMove = 0,
68
+ ManaMove = 1,
69
+ MysticAction = 2,
70
+ DemonAction = 3,
71
+ DemonAdditionalStep = 4,
72
+ SpiritTargetCapture = 5,
73
+ SpiritTargetMove = 6,
74
+ SelectConsumable = 7,
75
+ BombAttack = 8,
76
+ }
77
+ /**
78
+ */
80
79
  export enum AvailableMoveKind {
81
80
  MonMove = 0,
82
81
  ManaMove = 1,
@@ -85,6 +84,15 @@ export enum AvailableMoveKind {
85
84
  }
86
85
  /**
87
86
  */
87
+ export enum ItemModelKind {
88
+ Mon = 0,
89
+ Mana = 1,
90
+ MonWithMana = 2,
91
+ MonWithConsumable = 3,
92
+ Consumable = 4,
93
+ }
94
+ /**
95
+ */
88
96
  export enum EventModelKind {
89
97
  MonMove = 0,
90
98
  ManaMove = 1,
@@ -109,14 +117,6 @@ export enum EventModelKind {
109
117
  }
110
118
  /**
111
119
  */
112
- export enum OutputModelKind {
113
- InvalidInput = 0,
114
- LocationsToStartFrom = 1,
115
- NextInputOptions = 2,
116
- Events = 3,
117
- }
118
- /**
119
- */
120
120
  export class EventModel {
121
121
  free(): void;
122
122
  /**
@@ -522,7 +522,6 @@ export interface InitOutput {
522
522
  readonly __wbg_get_nextinputmodel_location: (a: number) => number;
523
523
  readonly __wbg_squaremodel_free: (a: number) => void;
524
524
  readonly __wbg_set_nextinputmodel_location: (a: number, b: number) => void;
525
- readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
526
525
  readonly __wbg_get_location_i: (a: number) => number;
527
526
  readonly __wbg_get_location_j: (a: number) => number;
528
527
  readonly __wbg_location_free: (a: number) => void;
@@ -540,14 +539,12 @@ export interface InitOutput {
540
539
  readonly mon_faint: (a: number) => void;
541
540
  readonly mon_is_fainted: (a: number) => number;
542
541
  readonly mon_new: (a: number, b: number, c: number) => number;
542
+ readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
543
543
  readonly __wbindgen_malloc: (a: number, b: number) => number;
544
544
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
545
- readonly __wbindgen_export_2: WebAssembly.Table;
546
- readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6e4ba54d26c28ebf: (a: number, b: number) => void;
547
545
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
548
546
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
549
547
  readonly __wbindgen_exn_store: (a: number) => void;
550
- readonly wasm_bindgen__convert__closures__invoke2_mut__h6cfc31b0a14c9fbd: (a: number, b: number, c: number, d: number) => void;
551
548
  }
552
549
 
553
550
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/mons-web.js CHANGED
@@ -116,40 +116,6 @@ function getInt32Memory0() {
116
116
  return cachedInt32Memory0;
117
117
  }
118
118
 
119
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
120
- ? { register: () => {}, unregister: () => {} }
121
- : new FinalizationRegistry(state => {
122
- wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b)
123
- });
124
-
125
- function makeMutClosure(arg0, arg1, dtor, f) {
126
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
127
- const real = (...args) => {
128
- // First up with a closure we increment the internal reference
129
- // count. This ensures that the Rust closure environment won't
130
- // be deallocated while we're invoking it.
131
- state.cnt++;
132
- const a = state.a;
133
- state.a = 0;
134
- try {
135
- return f(a, state.b, ...args);
136
- } finally {
137
- if (--state.cnt === 0) {
138
- wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
139
- CLOSURE_DTORS.unregister(state);
140
- } else {
141
- state.a = a;
142
- }
143
- }
144
- };
145
- real.original = state;
146
- CLOSURE_DTORS.register(real, state, state);
147
- return real;
148
- }
149
- function __wbg_adapter_26(arg0, arg1) {
150
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6e4ba54d26c28ebf(arg0, arg1);
151
- }
152
-
153
119
  let cachedUint32Memory0 = null;
154
120
 
155
121
  function getUint32Memory0() {
@@ -230,43 +196,39 @@ function handleError(f, args) {
230
196
  wasm.__wbindgen_exn_store(addHeapObject(e));
231
197
  }
232
198
  }
233
- function __wbg_adapter_151(arg0, arg1, arg2, arg3) {
234
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h6cfc31b0a14c9fbd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
235
- }
236
-
237
- /**
238
- */
239
- export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
240
199
  /**
241
200
  */
242
- export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
201
+ export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
243
202
  /**
244
203
  */
245
204
  export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
246
205
  /**
247
206
  */
248
- export const NextInputKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",MysticAction:2,"2":"MysticAction",DemonAction:3,"3":"DemonAction",DemonAdditionalStep:4,"4":"DemonAdditionalStep",SpiritTargetCapture:5,"5":"SpiritTargetCapture",SpiritTargetMove:6,"6":"SpiritTargetMove",SelectConsumable:7,"7":"SelectConsumable",BombAttack:8,"8":"BombAttack", });
207
+ export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
249
208
  /**
250
209
  */
251
- export const ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
210
+ export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
252
211
  /**
253
212
  */
254
213
  export const MonKind = Object.freeze({ Demon:0,"0":"Demon",Drainer:1,"1":"Drainer",Angel:2,"2":"Angel",Spirit:3,"3":"Spirit",Mystic:4,"4":"Mystic", });
255
214
  /**
256
215
  */
257
- export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
216
+ export const SquareModelKind = Object.freeze({ Regular:0,"0":"Regular",ConsumableBase:1,"1":"ConsumableBase",SupermanaBase:2,"2":"SupermanaBase",ManaBase:3,"3":"ManaBase",ManaPool:4,"4":"ManaPool",MonBase:5,"5":"MonBase", });
258
217
  /**
259
218
  */
260
- export const SquareModelKind = Object.freeze({ Regular:0,"0":"Regular",ConsumableBase:1,"1":"ConsumableBase",SupermanaBase:2,"2":"SupermanaBase",ManaBase:3,"3":"ManaBase",ManaPool:4,"4":"ManaPool",MonBase:5,"5":"MonBase", });
219
+ export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
220
+ /**
221
+ */
222
+ export const NextInputKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",MysticAction:2,"2":"MysticAction",DemonAction:3,"3":"DemonAction",DemonAdditionalStep:4,"4":"DemonAdditionalStep",SpiritTargetCapture:5,"5":"SpiritTargetCapture",SpiritTargetMove:6,"6":"SpiritTargetMove",SelectConsumable:7,"7":"SelectConsumable",BombAttack:8,"8":"BombAttack", });
261
223
  /**
262
224
  */
263
225
  export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
264
226
  /**
265
227
  */
266
- export const EventModelKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",ManaScored:2,"2":"ManaScored",MysticAction:3,"3":"MysticAction",DemonAction:4,"4":"DemonAction",DemonAdditionalStep:5,"5":"DemonAdditionalStep",SpiritTargetMove:6,"6":"SpiritTargetMove",PickupBomb:7,"7":"PickupBomb",PickupPotion:8,"8":"PickupPotion",PickupMana:9,"9":"PickupMana",MonFainted:10,"10":"MonFainted",ManaDropped:11,"11":"ManaDropped",SupermanaBackToBase:12,"12":"SupermanaBackToBase",BombAttack:13,"13":"BombAttack",MonAwake:14,"14":"MonAwake",BombExplosion:15,"15":"BombExplosion",NextTurn:16,"16":"NextTurn",GameOver:17,"17":"GameOver",Takeback:18,"18":"Takeback",UsePotion:19,"19":"UsePotion", });
228
+ export const ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
267
229
  /**
268
230
  */
269
- export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
231
+ export const EventModelKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",ManaScored:2,"2":"ManaScored",MysticAction:3,"3":"MysticAction",DemonAction:4,"4":"DemonAction",DemonAdditionalStep:5,"5":"DemonAdditionalStep",SpiritTargetMove:6,"6":"SpiritTargetMove",PickupBomb:7,"7":"PickupBomb",PickupPotion:8,"8":"PickupPotion",PickupMana:9,"9":"PickupMana",MonFainted:10,"10":"MonFainted",ManaDropped:11,"11":"ManaDropped",SupermanaBackToBase:12,"12":"SupermanaBackToBase",BombAttack:13,"13":"BombAttack",MonAwake:14,"14":"MonAwake",BombExplosion:15,"15":"BombExplosion",NextTurn:16,"16":"NextTurn",GameOver:17,"17":"GameOver",Takeback:18,"18":"Takeback",UsePotion:19,"19":"UsePotion", });
270
232
 
271
233
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
272
234
  ? { register: () => {}, unregister: () => {} }
@@ -1443,35 +1405,10 @@ function __wbg_get_imports() {
1443
1405
  const ret = getStringFromWasm0(arg0, arg1);
1444
1406
  return addHeapObject(ret);
1445
1407
  };
1446
- imports.wbg.__wbindgen_is_function = function(arg0) {
1447
- const ret = typeof(getObject(arg0)) === 'function';
1448
- return ret;
1449
- };
1450
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1451
- const ret = getObject(arg0);
1452
- return addHeapObject(ret);
1453
- };
1454
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
1455
- const obj = takeObject(arg0).original;
1456
- if (obj.cnt-- == 1) {
1457
- obj.a = 0;
1458
- return true;
1459
- }
1460
- const ret = false;
1461
- return ret;
1462
- };
1463
- imports.wbg.__wbindgen_number_new = function(arg0) {
1464
- const ret = arg0;
1465
- return addHeapObject(ret);
1466
- };
1467
1408
  imports.wbg.__wbg_outputmodel_new = function(arg0) {
1468
1409
  const ret = OutputModel.__wrap(arg0);
1469
1410
  return addHeapObject(ret);
1470
1411
  };
1471
- imports.wbg.__wbg_eventmodel_new = function(arg0) {
1472
- const ret = EventModel.__wrap(arg0);
1473
- return addHeapObject(ret);
1474
- };
1475
1412
  imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
1476
1413
  const ret = NextInputModel.__wrap(arg0);
1477
1414
  return addHeapObject(ret);
@@ -1480,14 +1417,18 @@ function __wbg_get_imports() {
1480
1417
  const ret = Location.__wrap(arg0);
1481
1418
  return addHeapObject(ret);
1482
1419
  };
1483
- imports.wbg.__wbg_location_unwrap = function(arg0) {
1484
- const ret = Location.__unwrap(takeObject(arg0));
1485
- return ret;
1420
+ imports.wbg.__wbg_eventmodel_new = function(arg0) {
1421
+ const ret = EventModel.__wrap(arg0);
1422
+ return addHeapObject(ret);
1486
1423
  };
1487
1424
  imports.wbg.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1488
1425
  const ret = VerboseTrackingEntityModel.__wrap(arg0);
1489
1426
  return addHeapObject(ret);
1490
1427
  };
1428
+ imports.wbg.__wbg_location_unwrap = function(arg0) {
1429
+ const ret = Location.__unwrap(takeObject(arg0));
1430
+ return ret;
1431
+ };
1491
1432
  imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
1492
1433
  const ret = getObject(arg0).crypto;
1493
1434
  return addHeapObject(ret);
@@ -1517,6 +1458,10 @@ function __wbg_get_imports() {
1517
1458
  const ret = module.require;
1518
1459
  return addHeapObject(ret);
1519
1460
  }, arguments) };
1461
+ imports.wbg.__wbindgen_is_function = function(arg0) {
1462
+ const ret = typeof(getObject(arg0)) === 'function';
1463
+ return ret;
1464
+ };
1520
1465
  imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
1521
1466
  const ret = getObject(arg0).msCrypto;
1522
1467
  return addHeapObject(ret);
@@ -1586,23 +1531,9 @@ function __wbg_get_imports() {
1586
1531
  const ret = getObject(arg0).call(getObject(arg1));
1587
1532
  return addHeapObject(ret);
1588
1533
  }, arguments) };
1589
- imports.wbg.__wbg_new_81740750da40724f = function(arg0, arg1) {
1590
- try {
1591
- var state0 = {a: arg0, b: arg1};
1592
- var cb0 = (arg0, arg1) => {
1593
- const a = state0.a;
1594
- state0.a = 0;
1595
- try {
1596
- return __wbg_adapter_151(a, state0.b, arg0, arg1);
1597
- } finally {
1598
- state0.a = a;
1599
- }
1600
- };
1601
- const ret = new Promise(cb0);
1602
- return addHeapObject(ret);
1603
- } finally {
1604
- state0.a = state0.b = 0;
1605
- }
1534
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1535
+ const ret = getObject(arg0);
1536
+ return addHeapObject(ret);
1606
1537
  };
1607
1538
  imports.wbg.__wbg_reject_a778418101c86bc9 = function(arg0) {
1608
1539
  const ret = Promise.reject(getObject(arg0));
@@ -1616,14 +1547,6 @@ function __wbg_get_imports() {
1616
1547
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1617
1548
  return addHeapObject(ret);
1618
1549
  }, arguments) };
1619
- imports.wbg.__wbg_call_8e7cb608789c2528 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1620
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
1621
- return addHeapObject(ret);
1622
- }, arguments) };
1623
- imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
1624
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
1625
- return addHeapObject(ret);
1626
- }, arguments) };
1627
1550
  imports.wbg.__wbindgen_memory = function() {
1628
1551
  const ret = wasm.memory;
1629
1552
  return addHeapObject(ret);
@@ -1631,10 +1554,6 @@ function __wbg_get_imports() {
1631
1554
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1632
1555
  throw new Error(getStringFromWasm0(arg0, arg1));
1633
1556
  };
1634
- imports.wbg.__wbindgen_closure_wrapper505 = function(arg0, arg1, arg2) {
1635
- const ret = makeMutClosure(arg0, arg1, 19, __wbg_adapter_26);
1636
- return addHeapObject(ret);
1637
- };
1638
1557
 
1639
1558
  return imports;
1640
1559
  }
package/mons-web_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mons-web",
3
3
  "type": "module",
4
4
  "description": "super metal mons",
5
- "version": "0.1.112",
5
+ "version": "0.1.114",
6
6
  "license": "CC0-1.0",
7
7
  "repository": {
8
8
  "type": "git",