mons-web 0.1.82 → 0.1.84

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/README.md CHANGED
@@ -5,6 +5,28 @@ or
5
5
 
6
6
  `npm install mons-rust`
7
7
 
8
+ ## rules-tests runner
9
+
10
+ Run all fixtures in `rules-tests`:
11
+
12
+ `./scripts/run-rules-tests.sh`
13
+
14
+ Useful options:
15
+
16
+ `./scripts/run-rules-tests.sh --limit 100`
17
+
18
+ `./scripts/run-rules-tests.sh --log /tmp/rules-tests.log`
19
+
20
+ ## rules-tests generator
21
+
22
+ Generate new random unique fixtures in `rules-tests`:
23
+
24
+ `./scripts/generate-rules-tests.sh --target-new 100`
25
+
26
+ Run continuously until interrupted:
27
+
28
+ `./scripts/generate-rules-tests.sh`
29
+
8
30
  ## publishing to npm
9
31
 
10
- `./publish.sh`
32
+ `./publish.sh`
package/mons-web.d.ts CHANGED
@@ -10,18 +10,51 @@
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 SquareModelKind {
14
+ Regular = 0,
15
+ ConsumableBase = 1,
16
+ SupermanaBase = 2,
17
+ ManaBase = 3,
18
+ ManaPool = 4,
19
+ MonBase = 5,
20
+ }
21
+ /**
22
+ */
23
+ export enum Modifier {
24
+ SelectPotion = 0,
25
+ SelectBomb = 1,
26
+ Cancel = 2,
27
+ }
28
+ /**
29
+ */
13
30
  export enum ManaKind {
14
31
  Regular = 0,
15
32
  Supermana = 1,
16
33
  }
17
34
  /**
18
35
  */
19
- export enum ItemModelKind {
20
- Mon = 0,
21
- Mana = 1,
22
- MonWithMana = 2,
23
- MonWithConsumable = 3,
24
- Consumable = 4,
36
+ export enum OutputModelKind {
37
+ InvalidInput = 0,
38
+ LocationsToStartFrom = 1,
39
+ NextInputOptions = 2,
40
+ Events = 3,
41
+ }
42
+ /**
43
+ */
44
+ export enum AvailableMoveKind {
45
+ MonMove = 0,
46
+ ManaMove = 1,
47
+ Action = 2,
48
+ Potion = 3,
49
+ }
50
+ /**
51
+ */
52
+ export enum MonKind {
53
+ Demon = 0,
54
+ Drainer = 1,
55
+ Angel = 2,
56
+ Spirit = 3,
57
+ Mystic = 4,
25
58
  }
26
59
  /**
27
60
  */
@@ -49,16 +82,6 @@ export enum EventModelKind {
49
82
  }
50
83
  /**
51
84
  */
52
- export enum SquareModelKind {
53
- Regular = 0,
54
- ConsumableBase = 1,
55
- SupermanaBase = 2,
56
- ManaBase = 3,
57
- ManaPool = 4,
58
- MonBase = 5,
59
- }
60
- /**
61
- */
62
85
  export enum NextInputKind {
63
86
  MonMove = 0,
64
87
  ManaMove = 1,
@@ -72,41 +95,18 @@ export enum NextInputKind {
72
95
  }
73
96
  /**
74
97
  */
75
- export enum Modifier {
76
- SelectPotion = 0,
77
- SelectBomb = 1,
78
- Cancel = 2,
79
- }
80
- /**
81
- */
82
- export enum AvailableMoveKind {
83
- MonMove = 0,
84
- ManaMove = 1,
85
- Action = 2,
86
- Potion = 3,
87
- }
88
- /**
89
- */
90
98
  export enum Color {
91
99
  White = 0,
92
100
  Black = 1,
93
101
  }
94
102
  /**
95
103
  */
96
- export enum OutputModelKind {
97
- InvalidInput = 0,
98
- LocationsToStartFrom = 1,
99
- NextInputOptions = 2,
100
- Events = 3,
101
- }
102
- /**
103
- */
104
- export enum MonKind {
105
- Demon = 0,
106
- Drainer = 1,
107
- Angel = 2,
108
- Spirit = 3,
109
- Mystic = 4,
104
+ export enum ItemModelKind {
105
+ Mon = 0,
106
+ Mana = 1,
107
+ MonWithMana = 2,
108
+ MonWithConsumable = 3,
109
+ Consumable = 4,
110
110
  }
111
111
  /**
112
112
  */
@@ -528,28 +528,28 @@ export interface InitOutput {
528
528
  readonly __wbg_get_nextinputmodel_location: (a: number) => number;
529
529
  readonly __wbg_squaremodel_free: (a: number) => void;
530
530
  readonly __wbg_set_nextinputmodel_location: (a: number, b: number) => void;
531
- readonly __wbg_get_location_i: (a: number) => number;
532
- readonly __wbg_get_location_j: (a: number) => number;
533
531
  readonly __wbg_get_mon_color: (a: number) => number;
532
+ readonly __wbg_get_mon_cooldown: (a: number) => number;
534
533
  readonly __wbg_get_mon_kind: (a: number) => number;
535
- readonly __wbg_location_free: (a: number) => void;
536
534
  readonly __wbg_mon_free: (a: number) => void;
537
- readonly __wbg_set_location_i: (a: number, b: number) => void;
538
- readonly __wbg_set_location_j: (a: number, b: number) => void;
539
535
  readonly __wbg_set_mon_color: (a: number, b: number) => void;
536
+ readonly __wbg_set_mon_cooldown: (a: number, b: number) => void;
540
537
  readonly __wbg_set_mon_kind: (a: number, b: number) => void;
541
538
  readonly mon_decrease_cooldown: (a: number) => void;
542
539
  readonly mon_faint: (a: number) => void;
543
540
  readonly mon_is_fainted: (a: number) => number;
544
541
  readonly mon_new: (a: number, b: number, c: number) => number;
545
- readonly __wbg_set_mon_cooldown: (a: number, b: number) => void;
546
- readonly location_new: (a: number, b: number) => number;
547
- readonly __wbg_get_mon_cooldown: (a: number) => number;
548
542
  readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
543
+ readonly __wbg_get_location_i: (a: number) => number;
544
+ readonly __wbg_get_location_j: (a: number) => number;
545
+ readonly __wbg_location_free: (a: number) => void;
546
+ readonly __wbg_set_location_i: (a: number, b: number) => void;
547
+ readonly __wbg_set_location_j: (a: number, b: number) => void;
548
+ readonly location_new: (a: number, b: number) => number;
549
549
  readonly __wbindgen_malloc: (a: number, b: number) => number;
550
550
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
551
551
  readonly __wbindgen_export_2: WebAssembly.Table;
552
- readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3fb1aa55fa18b074: (a: number, b: number) => void;
552
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd118e63d1b16d9ab: (a: number, b: number) => void;
553
553
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
554
554
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
555
555
  readonly __wbindgen_exn_store: (a: number) => void;
package/mons-web.js CHANGED
@@ -147,7 +147,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
147
147
  return real;
148
148
  }
149
149
  function __wbg_adapter_26(arg0, arg1) {
150
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3fb1aa55fa18b074(arg0, arg1);
150
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd118e63d1b16d9ab(arg0, arg1);
151
151
  }
152
152
 
153
153
  let cachedUint32Memory0 = null;
@@ -236,34 +236,34 @@ function __wbg_adapter_152(arg0, arg1, arg2, arg3) {
236
236
 
237
237
  /**
238
238
  */
239
- export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
239
+ 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", });
240
240
  /**
241
241
  */
242
- 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", });
242
+ export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
243
243
  /**
244
244
  */
245
- 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", });
245
+ export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
246
246
  /**
247
247
  */
248
- 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", });
248
+ export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
249
249
  /**
250
250
  */
251
- 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", });
251
+ export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
252
252
  /**
253
253
  */
254
- export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
254
+ 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
255
  /**
256
256
  */
257
- export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
257
+ 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", });
258
258
  /**
259
259
  */
260
- export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
260
+ 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
261
  /**
262
262
  */
263
- export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
263
+ export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
264
264
  /**
265
265
  */
266
- 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", });
266
+ 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
267
  /**
268
268
  */
269
269
  export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
@@ -682,14 +682,14 @@ export class Mon {
682
682
  * @returns {number}
683
683
  */
684
684
  get cooldown() {
685
- const ret = wasm.__wbg_get_location_i(this.__wbg_ptr);
685
+ const ret = wasm.__wbg_get_mon_cooldown(this.__wbg_ptr);
686
686
  return ret;
687
687
  }
688
688
  /**
689
689
  * @param {number} arg0
690
690
  */
691
691
  set cooldown(arg0) {
692
- wasm.__wbg_set_location_i(this.__wbg_ptr, arg0);
692
+ wasm.__wbg_set_mon_cooldown(this.__wbg_ptr, arg0);
693
693
  }
694
694
  /**
695
695
  * @returns {boolean}
@@ -1442,16 +1442,16 @@ async function __wbg_load(module, imports) {
1442
1442
  function __wbg_get_imports() {
1443
1443
  const imports = {};
1444
1444
  imports.wbg = {};
1445
- imports.wbg.__wbindgen_number_new = function(arg0) {
1446
- const ret = arg0;
1445
+ imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
1446
+ const ret = NextInputModel.__wrap(arg0);
1447
1447
  return addHeapObject(ret);
1448
1448
  };
1449
1449
  imports.wbg.__wbg_location_new = function(arg0) {
1450
1450
  const ret = Location.__wrap(arg0);
1451
1451
  return addHeapObject(ret);
1452
1452
  };
1453
- imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
1454
- const ret = NextInputModel.__wrap(arg0);
1453
+ imports.wbg.__wbindgen_number_new = function(arg0) {
1454
+ const ret = arg0;
1455
1455
  return addHeapObject(ret);
1456
1456
  };
1457
1457
  imports.wbg.__wbg_eventmodel_new = function(arg0) {
@@ -1633,8 +1633,8 @@ function __wbg_get_imports() {
1633
1633
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1634
1634
  throw new Error(getStringFromWasm0(arg0, arg1));
1635
1635
  };
1636
- imports.wbg.__wbindgen_closure_wrapper379 = function(arg0, arg1, arg2) {
1637
- const ret = makeMutClosure(arg0, arg1, 23, __wbg_adapter_26);
1636
+ imports.wbg.__wbindgen_closure_wrapper306 = function(arg0, arg1, arg2) {
1637
+ const ret = makeMutClosure(arg0, arg1, 11, __wbg_adapter_26);
1638
1638
  return addHeapObject(ret);
1639
1639
  };
1640
1640
 
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.82",
5
+ "version": "0.1.84",
6
6
  "license": "CC0-1.0",
7
7
  "repository": {
8
8
  "type": "git",