mons-rust 0.1.82 → 0.1.85

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-rust.d.ts CHANGED
@@ -10,37 +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 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 ItemModelKind {
24
- Mon = 0,
25
- Mana = 1,
26
- MonWithMana = 2,
27
- MonWithConsumable = 3,
28
- Consumable = 4,
29
- }
30
- /**
31
- */
32
- export enum Consumable {
33
- Potion = 0,
34
- Bomb = 1,
35
- BombOrPotion = 2,
36
- }
37
- /**
38
- */
39
- export enum AvailableMoveKind {
40
- MonMove = 0,
41
- ManaMove = 1,
42
- Action = 2,
43
- Potion = 3,
13
+ export enum OutputModelKind {
14
+ InvalidInput = 0,
15
+ LocationsToStartFrom = 1,
16
+ NextInputOptions = 2,
17
+ Events = 3,
44
18
  }
45
19
  /**
46
20
  */
@@ -53,40 +27,6 @@ export enum MonKind {
53
27
  }
54
28
  /**
55
29
  */
56
- export enum Modifier {
57
- SelectPotion = 0,
58
- SelectBomb = 1,
59
- Cancel = 2,
60
- }
61
- /**
62
- */
63
- export enum NextInputKind {
64
- MonMove = 0,
65
- ManaMove = 1,
66
- MysticAction = 2,
67
- DemonAction = 3,
68
- DemonAdditionalStep = 4,
69
- SpiritTargetCapture = 5,
70
- SpiritTargetMove = 6,
71
- SelectConsumable = 7,
72
- BombAttack = 8,
73
- }
74
- /**
75
- */
76
- export enum Color {
77
- White = 0,
78
- Black = 1,
79
- }
80
- /**
81
- */
82
- export enum OutputModelKind {
83
- InvalidInput = 0,
84
- LocationsToStartFrom = 1,
85
- NextInputOptions = 2,
86
- Events = 3,
87
- }
88
- /**
89
- */
90
30
  export enum EventModelKind {
91
31
  MonMove = 0,
92
32
  ManaMove = 1,
@@ -111,12 +51,72 @@ export enum EventModelKind {
111
51
  }
112
52
  /**
113
53
  */
54
+ export enum Color {
55
+ White = 0,
56
+ Black = 1,
57
+ }
58
+ /**
59
+ */
60
+ export enum NextInputKind {
61
+ MonMove = 0,
62
+ ManaMove = 1,
63
+ MysticAction = 2,
64
+ DemonAction = 3,
65
+ DemonAdditionalStep = 4,
66
+ SpiritTargetCapture = 5,
67
+ SpiritTargetMove = 6,
68
+ SelectConsumable = 7,
69
+ BombAttack = 8,
70
+ }
71
+ /**
72
+ */
73
+ export enum Modifier {
74
+ SelectPotion = 0,
75
+ SelectBomb = 1,
76
+ Cancel = 2,
77
+ }
78
+ /**
79
+ */
80
+ export enum ItemModelKind {
81
+ Mon = 0,
82
+ Mana = 1,
83
+ MonWithMana = 2,
84
+ MonWithConsumable = 3,
85
+ Consumable = 4,
86
+ }
87
+ /**
88
+ */
114
89
  export enum ManaKind {
115
90
  Regular = 0,
116
91
  Supermana = 1,
117
92
  }
118
93
  /**
119
94
  */
95
+ export enum SquareModelKind {
96
+ Regular = 0,
97
+ ConsumableBase = 1,
98
+ SupermanaBase = 2,
99
+ ManaBase = 3,
100
+ ManaPool = 4,
101
+ MonBase = 5,
102
+ }
103
+ /**
104
+ */
105
+ export enum AvailableMoveKind {
106
+ MonMove = 0,
107
+ ManaMove = 1,
108
+ Action = 2,
109
+ Potion = 3,
110
+ }
111
+ /**
112
+ */
113
+ export enum Consumable {
114
+ Potion = 0,
115
+ Bomb = 1,
116
+ BombOrPotion = 2,
117
+ }
118
+ /**
119
+ */
120
120
  export class EventModel {
121
121
  free(): void;
122
122
  /**
package/mons-rust.js CHANGED
@@ -150,7 +150,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
150
150
  return real;
151
151
  }
152
152
  function __wbg_adapter_26(arg0, arg1) {
153
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3fb1aa55fa18b074(arg0, arg1);
153
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h707a48f6f45da428(arg0, arg1);
154
154
  }
155
155
 
156
156
  let cachedUint32Memory0 = null;
@@ -239,37 +239,37 @@ function __wbg_adapter_152(arg0, arg1, arg2, arg3) {
239
239
 
240
240
  /**
241
241
  */
242
- module.exports.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", });
242
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
243
243
  /**
244
244
  */
245
- module.exports.ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
245
+ module.exports.MonKind = Object.freeze({ Demon:0,"0":"Demon",Drainer:1,"1":"Drainer",Angel:2,"2":"Angel",Spirit:3,"3":"Spirit",Mystic:4,"4":"Mystic", });
246
246
  /**
247
247
  */
248
- module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
248
+ module.exports.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", });
249
249
  /**
250
250
  */
251
- module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
251
+ module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
252
252
  /**
253
253
  */
254
- module.exports.MonKind = Object.freeze({ Demon:0,"0":"Demon",Drainer:1,"1":"Drainer",Angel:2,"2":"Angel",Spirit:3,"3":"Spirit",Mystic:4,"4":"Mystic", });
254
+ module.exports.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", });
255
255
  /**
256
256
  */
257
257
  module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
258
258
  /**
259
259
  */
260
- module.exports.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", });
260
+ module.exports.ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
261
261
  /**
262
262
  */
263
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
263
+ module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
264
264
  /**
265
265
  */
266
- module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
266
+ module.exports.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", });
267
267
  /**
268
268
  */
269
- module.exports.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", });
269
+ module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
270
270
  /**
271
271
  */
272
- module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
272
+ module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
273
273
 
274
274
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
275
275
  ? { register: () => {}, unregister: () => {} }
@@ -689,14 +689,14 @@ class Mon {
689
689
  * @returns {number}
690
690
  */
691
691
  get cooldown() {
692
- const ret = wasm.__wbg_get_location_i(this.__wbg_ptr);
692
+ const ret = wasm.__wbg_get_mon_cooldown(this.__wbg_ptr);
693
693
  return ret;
694
694
  }
695
695
  /**
696
696
  * @param {number} arg0
697
697
  */
698
698
  set cooldown(arg0) {
699
- wasm.__wbg_set_location_i(this.__wbg_ptr, arg0);
699
+ wasm.__wbg_set_mon_cooldown(this.__wbg_ptr, arg0);
700
700
  }
701
701
  /**
702
702
  * @returns {boolean}
@@ -1421,8 +1421,8 @@ class VerboseTrackingEntityModel {
1421
1421
  }
1422
1422
  module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
1423
1423
 
1424
- module.exports.__wbindgen_number_new = function(arg0) {
1425
- const ret = arg0;
1424
+ module.exports.__wbg_eventmodel_new = function(arg0) {
1425
+ const ret = EventModel.__wrap(arg0);
1426
1426
  return addHeapObject(ret);
1427
1427
  };
1428
1428
 
@@ -1431,13 +1431,18 @@ module.exports.__wbg_location_new = function(arg0) {
1431
1431
  return addHeapObject(ret);
1432
1432
  };
1433
1433
 
1434
+ module.exports.__wbindgen_number_new = function(arg0) {
1435
+ const ret = arg0;
1436
+ return addHeapObject(ret);
1437
+ };
1438
+
1434
1439
  module.exports.__wbg_nextinputmodel_new = function(arg0) {
1435
1440
  const ret = NextInputModel.__wrap(arg0);
1436
1441
  return addHeapObject(ret);
1437
1442
  };
1438
1443
 
1439
- module.exports.__wbg_eventmodel_new = function(arg0) {
1440
- const ret = EventModel.__wrap(arg0);
1444
+ module.exports.__wbg_outputmodel_new = function(arg0) {
1445
+ const ret = OutputModel.__wrap(arg0);
1441
1446
  return addHeapObject(ret);
1442
1447
  };
1443
1448
 
@@ -1446,11 +1451,6 @@ module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1446
1451
  return addHeapObject(ret);
1447
1452
  };
1448
1453
 
1449
- module.exports.__wbg_outputmodel_new = function(arg0) {
1450
- const ret = OutputModel.__wrap(arg0);
1451
- return addHeapObject(ret);
1452
- };
1453
-
1454
1454
  module.exports.__wbindgen_object_drop_ref = function(arg0) {
1455
1455
  takeObject(arg0);
1456
1456
  };
@@ -1655,8 +1655,8 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
1655
1655
  throw new Error(getStringFromWasm0(arg0, arg1));
1656
1656
  };
1657
1657
 
1658
- module.exports.__wbindgen_closure_wrapper379 = function(arg0, arg1, arg2) {
1659
- const ret = makeMutClosure(arg0, arg1, 23, __wbg_adapter_26);
1658
+ module.exports.__wbindgen_closure_wrapper306 = function(arg0, arg1, arg2) {
1659
+ const ret = makeMutClosure(arg0, arg1, 11, __wbg_adapter_26);
1660
1660
  return addHeapObject(ret);
1661
1661
  };
1662
1662
 
package/mons-rust_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mons-rust",
3
3
  "description": "super metal mons",
4
- "version": "0.1.82",
4
+ "version": "0.1.85",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",