mons-rust 0.1.59 → 0.1.61

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-rust.d.ts CHANGED
@@ -10,16 +10,6 @@
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
13
  export enum ItemModelKind {
24
14
  Mon = 0,
25
15
  Mana = 1,
@@ -29,30 +19,6 @@ export enum ItemModelKind {
29
19
  }
30
20
  /**
31
21
  */
32
- export enum EventModelKind {
33
- MonMove = 0,
34
- ManaMove = 1,
35
- ManaScored = 2,
36
- MysticAction = 3,
37
- DemonAction = 4,
38
- DemonAdditionalStep = 5,
39
- SpiritTargetMove = 6,
40
- PickupBomb = 7,
41
- PickupPotion = 8,
42
- PickupMana = 9,
43
- MonFainted = 10,
44
- ManaDropped = 11,
45
- SupermanaBackToBase = 12,
46
- BombAttack = 13,
47
- MonAwake = 14,
48
- BombExplosion = 15,
49
- NextTurn = 16,
50
- GameOver = 17,
51
- Takeback = 18,
52
- UsePotion = 19,
53
- }
54
- /**
55
- */
56
22
  export enum MonKind {
57
23
  Demon = 0,
58
24
  Drainer = 1,
@@ -62,9 +28,16 @@ export enum MonKind {
62
28
  }
63
29
  /**
64
30
  */
65
- export enum Color {
66
- White = 0,
67
- Black = 1,
31
+ export enum NextInputKind {
32
+ MonMove = 0,
33
+ ManaMove = 1,
34
+ MysticAction = 2,
35
+ DemonAction = 3,
36
+ DemonAdditionalStep = 4,
37
+ SpiritTargetCapture = 5,
38
+ SpiritTargetMove = 6,
39
+ SelectConsumable = 7,
40
+ BombAttack = 8,
68
41
  }
69
42
  /**
70
43
  */
@@ -76,36 +49,57 @@ export enum AvailableMoveKind {
76
49
  }
77
50
  /**
78
51
  */
79
- export enum Modifier {
80
- SelectPotion = 0,
81
- SelectBomb = 1,
82
- Cancel = 2,
52
+ export enum Consumable {
53
+ Potion = 0,
54
+ Bomb = 1,
55
+ BombOrPotion = 2,
83
56
  }
84
57
  /**
85
58
  */
86
- export enum ManaKind {
59
+ export enum SquareModelKind {
87
60
  Regular = 0,
88
- Supermana = 1,
61
+ ConsumableBase = 1,
62
+ SupermanaBase = 2,
63
+ ManaBase = 3,
64
+ ManaPool = 4,
65
+ MonBase = 5,
89
66
  }
90
67
  /**
91
68
  */
92
- export enum Consumable {
93
- Potion = 0,
94
- Bomb = 1,
95
- BombOrPotion = 2,
69
+ export enum Modifier {
70
+ SelectPotion = 0,
71
+ SelectBomb = 1,
72
+ Cancel = 2,
96
73
  }
97
74
  /**
98
75
  */
99
- export enum NextInputKind {
76
+ export enum EventModelKind {
100
77
  MonMove = 0,
101
78
  ManaMove = 1,
102
- MysticAction = 2,
103
- DemonAction = 3,
104
- DemonAdditionalStep = 4,
105
- SpiritTargetCapture = 5,
79
+ ManaScored = 2,
80
+ MysticAction = 3,
81
+ DemonAction = 4,
82
+ DemonAdditionalStep = 5,
106
83
  SpiritTargetMove = 6,
107
- SelectConsumable = 7,
108
- BombAttack = 8,
84
+ PickupBomb = 7,
85
+ PickupPotion = 8,
86
+ PickupMana = 9,
87
+ MonFainted = 10,
88
+ ManaDropped = 11,
89
+ SupermanaBackToBase = 12,
90
+ BombAttack = 13,
91
+ MonAwake = 14,
92
+ BombExplosion = 15,
93
+ NextTurn = 16,
94
+ GameOver = 17,
95
+ Takeback = 18,
96
+ UsePotion = 19,
97
+ }
98
+ /**
99
+ */
100
+ export enum ManaKind {
101
+ Regular = 0,
102
+ Supermana = 1,
109
103
  }
110
104
  /**
111
105
  */
@@ -117,6 +111,12 @@ export enum OutputModelKind {
117
111
  }
118
112
  /**
119
113
  */
114
+ export enum Color {
115
+ White = 0,
116
+ Black = 1,
117
+ }
118
+ /**
119
+ */
120
120
  export class EventModel {
121
121
  free(): void;
122
122
  /**
@@ -319,6 +319,10 @@ export class MonsGameModel {
319
319
  */
320
320
  inactive_player_items_counters(): Int32Array;
321
321
  /**
322
+ * @returns {(string)[]}
323
+ */
324
+ takeback_fens(): (string)[];
325
+ /**
322
326
  * @returns {Int32Array}
323
327
  */
324
328
  available_move_kinds(): Int32Array;
package/mons-rust.js CHANGED
@@ -201,37 +201,37 @@ function handleError(f, args) {
201
201
  }
202
202
  /**
203
203
  */
204
- 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", });
204
+ 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", });
205
205
  /**
206
206
  */
207
- 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", });
207
+ 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", });
208
208
  /**
209
209
  */
210
- 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", });
210
+ 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", });
211
211
  /**
212
212
  */
213
- 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", });
213
+ module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
214
214
  /**
215
215
  */
216
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
216
+ module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
217
217
  /**
218
218
  */
219
- module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
219
+ 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", });
220
220
  /**
221
221
  */
222
222
  module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
223
223
  /**
224
224
  */
225
- module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
225
+ 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", });
226
226
  /**
227
227
  */
228
- module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
228
+ module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
229
229
  /**
230
230
  */
231
- 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", });
231
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
232
232
  /**
233
233
  */
234
- module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
234
+ module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
235
235
 
236
236
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
237
237
  ? { register: () => {}, unregister: () => {} }
@@ -919,6 +919,22 @@ class MonsGameModel {
919
919
  }
920
920
  }
921
921
  /**
922
+ * @returns {(string)[]}
923
+ */
924
+ takeback_fens() {
925
+ try {
926
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
927
+ wasm.monsgamemodel_takeback_fens(retptr, this.__wbg_ptr);
928
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
929
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
930
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
931
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
932
+ return v1;
933
+ } finally {
934
+ wasm.__wbindgen_add_to_stack_pointer(16);
935
+ }
936
+ }
937
+ /**
922
938
  * @returns {Int32Array}
923
939
  */
924
940
  available_move_kinds() {
@@ -1320,13 +1336,13 @@ class VerboseTrackingEntityModel {
1320
1336
  }
1321
1337
  module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
1322
1338
 
1323
- module.exports.__wbg_eventmodel_new = function(arg0) {
1324
- const ret = EventModel.__wrap(arg0);
1339
+ module.exports.__wbg_location_new = function(arg0) {
1340
+ const ret = Location.__wrap(arg0);
1325
1341
  return addHeapObject(ret);
1326
1342
  };
1327
1343
 
1328
- module.exports.__wbg_location_new = function(arg0) {
1329
- const ret = Location.__wrap(arg0);
1344
+ module.exports.__wbg_eventmodel_new = function(arg0) {
1345
+ const ret = EventModel.__wrap(arg0);
1330
1346
  return addHeapObject(ret);
1331
1347
  };
1332
1348
 
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.59",
4
+ "version": "0.1.61",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",