mons-rust 0.1.27 → 0.1.29

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,25 +10,27 @@
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 MonKind {
14
- Demon = 0,
15
- Drainer = 1,
16
- Angel = 2,
17
- Spirit = 3,
18
- Mystic = 4,
13
+ export enum SquareModelKind {
14
+ Regular = 0,
15
+ ConsumableBase = 1,
16
+ SupermanaBase = 2,
17
+ ManaBase = 3,
18
+ ManaPool = 4,
19
+ MonBase = 5,
19
20
  }
20
21
  /**
21
22
  */
22
- export enum Modifier {
23
- SelectPotion = 0,
24
- SelectBomb = 1,
25
- Cancel = 2,
23
+ export enum AvailableMoveKind {
24
+ MonMove = 0,
25
+ ManaMove = 1,
26
+ Action = 2,
27
+ Potion = 3,
26
28
  }
27
29
  /**
28
30
  */
29
- export enum ManaKind {
30
- Regular = 0,
31
- Supermana = 1,
31
+ export enum Color {
32
+ White = 0,
33
+ Black = 1,
32
34
  }
33
35
  /**
34
36
  */
@@ -45,6 +47,15 @@ export enum NextInputKind {
45
47
  }
46
48
  /**
47
49
  */
50
+ export enum MonKind {
51
+ Demon = 0,
52
+ Drainer = 1,
53
+ Angel = 2,
54
+ Spirit = 3,
55
+ Mystic = 4,
56
+ }
57
+ /**
58
+ */
48
59
  export enum OutputModelKind {
49
60
  InvalidInput = 0,
50
61
  LocationsToStartFrom = 1,
@@ -53,22 +64,6 @@ export enum OutputModelKind {
53
64
  }
54
65
  /**
55
66
  */
56
- export enum Consumable {
57
- Potion = 0,
58
- Bomb = 1,
59
- BombOrPotion = 2,
60
- }
61
- /**
62
- */
63
- export enum ItemModelKind {
64
- Mon = 0,
65
- Mana = 1,
66
- MonWithMana = 2,
67
- MonWithConsumable = 3,
68
- Consumable = 4,
69
- }
70
- /**
71
- */
72
67
  export enum EventModelKind {
73
68
  MonMove = 0,
74
69
  ManaMove = 1,
@@ -88,30 +83,36 @@ export enum EventModelKind {
88
83
  BombExplosion = 15,
89
84
  NextTurn = 16,
90
85
  GameOver = 17,
86
+ Takeback = 18,
91
87
  }
92
88
  /**
93
89
  */
94
- export enum AvailableMoveKind {
95
- MonMove = 0,
96
- ManaMove = 1,
97
- Action = 2,
98
- Potion = 3,
90
+ export enum ItemModelKind {
91
+ Mon = 0,
92
+ Mana = 1,
93
+ MonWithMana = 2,
94
+ MonWithConsumable = 3,
95
+ Consumable = 4,
99
96
  }
100
97
  /**
101
98
  */
102
- export enum SquareModelKind {
99
+ export enum ManaKind {
103
100
  Regular = 0,
104
- ConsumableBase = 1,
105
- SupermanaBase = 2,
106
- ManaBase = 3,
107
- ManaPool = 4,
108
- MonBase = 5,
101
+ Supermana = 1,
109
102
  }
110
103
  /**
111
104
  */
112
- export enum Color {
113
- White = 0,
114
- Black = 1,
105
+ export enum Modifier {
106
+ SelectPotion = 0,
107
+ SelectBomb = 1,
108
+ Cancel = 2,
109
+ }
110
+ /**
111
+ */
112
+ export enum Consumable {
113
+ Potion = 0,
114
+ Bomb = 1,
115
+ BombOrPotion = 2,
115
116
  }
116
117
  /**
117
118
  */
@@ -238,6 +239,14 @@ export class MonsGameModel {
238
239
  */
239
240
  process_input(locations: (Location)[], modifier?: Modifier): OutputModel;
240
241
  /**
242
+ * @returns {boolean}
243
+ */
244
+ can_takeback(): boolean;
245
+ /**
246
+ * @returns {OutputModel}
247
+ */
248
+ takeback(): OutputModel;
249
+ /**
241
250
  * @param {string} input_fen
242
251
  * @returns {OutputModel}
243
252
  */
package/mons-rust.js CHANGED
@@ -194,37 +194,37 @@ module.exports.winner = function(fen_w, fen_b, flat_moves_string_w, flat_moves_s
194
194
 
195
195
  /**
196
196
  */
197
- 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", });
197
+ 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", });
198
198
  /**
199
199
  */
200
- module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
200
+ module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
201
201
  /**
202
202
  */
203
- module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
203
+ module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
204
204
  /**
205
205
  */
206
206
  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", });
207
207
  /**
208
208
  */
209
- module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
209
+ 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", });
210
210
  /**
211
211
  */
212
- module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
212
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
213
213
  /**
214
214
  */
215
- 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", });
215
+ 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", });
216
216
  /**
217
217
  */
218
- 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", });
218
+ 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", });
219
219
  /**
220
220
  */
221
- module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
221
+ module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
222
222
  /**
223
223
  */
224
- 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", });
224
+ module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
225
225
  /**
226
226
  */
227
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
227
+ module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
228
228
 
229
229
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
230
230
  ? { register: () => {}, unregister: () => {} }
@@ -757,6 +757,20 @@ class MonsGameModel {
757
757
  return OutputModel.__wrap(ret);
758
758
  }
759
759
  /**
760
+ * @returns {boolean}
761
+ */
762
+ can_takeback() {
763
+ const ret = wasm.monsgamemodel_can_takeback(this.__wbg_ptr);
764
+ return ret !== 0;
765
+ }
766
+ /**
767
+ * @returns {OutputModel}
768
+ */
769
+ takeback() {
770
+ const ret = wasm.monsgamemodel_takeback(this.__wbg_ptr);
771
+ return OutputModel.__wrap(ret);
772
+ }
773
+ /**
760
774
  * @param {string} input_fen
761
775
  * @returns {OutputModel}
762
776
  */
@@ -1127,13 +1141,13 @@ class SquareModel {
1127
1141
  }
1128
1142
  module.exports.SquareModel = SquareModel;
1129
1143
 
1130
- module.exports.__wbg_location_new = function(arg0) {
1131
- const ret = Location.__wrap(arg0);
1144
+ module.exports.__wbg_nextinputmodel_new = function(arg0) {
1145
+ const ret = NextInputModel.__wrap(arg0);
1132
1146
  return addHeapObject(ret);
1133
1147
  };
1134
1148
 
1135
- module.exports.__wbg_nextinputmodel_new = function(arg0) {
1136
- const ret = NextInputModel.__wrap(arg0);
1149
+ module.exports.__wbg_location_new = function(arg0) {
1150
+ const ret = Location.__wrap(arg0);
1137
1151
  return addHeapObject(ret);
1138
1152
  };
1139
1153
 
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.27",
4
+ "version": "0.1.29",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",