mons-rust 0.1.56 → 0.1.58

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,13 +10,17 @@
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,
13
+ export enum Color {
14
+ White = 0,
15
+ Black = 1,
16
+ }
17
+ /**
18
+ */
19
+ export enum AvailableMoveKind {
20
+ MonMove = 0,
21
+ ManaMove = 1,
22
+ Action = 2,
23
+ Potion = 3,
20
24
  }
21
25
  /**
22
26
  */
@@ -29,30 +33,10 @@ export enum ItemModelKind {
29
33
  }
30
34
  /**
31
35
  */
32
- export enum ManaKind {
33
- Regular = 0,
34
- Supermana = 1,
35
- }
36
- /**
37
- */
38
- export enum Consumable {
39
- Potion = 0,
40
- Bomb = 1,
41
- BombOrPotion = 2,
42
- }
43
- /**
44
- */
45
- export enum Color {
46
- White = 0,
47
- Black = 1,
48
- }
49
- /**
50
- */
51
- export enum OutputModelKind {
52
- InvalidInput = 0,
53
- LocationsToStartFrom = 1,
54
- NextInputOptions = 2,
55
- Events = 3,
36
+ export enum Modifier {
37
+ SelectPotion = 0,
38
+ SelectBomb = 1,
39
+ Cancel = 2,
56
40
  }
57
41
  /**
58
42
  */
@@ -89,10 +73,19 @@ export enum EventModelKind {
89
73
  }
90
74
  /**
91
75
  */
92
- export enum Modifier {
93
- SelectPotion = 0,
94
- SelectBomb = 1,
95
- Cancel = 2,
76
+ export enum SquareModelKind {
77
+ Regular = 0,
78
+ ConsumableBase = 1,
79
+ SupermanaBase = 2,
80
+ ManaBase = 3,
81
+ ManaPool = 4,
82
+ MonBase = 5,
83
+ }
84
+ /**
85
+ */
86
+ export enum ManaKind {
87
+ Regular = 0,
88
+ Supermana = 1,
96
89
  }
97
90
  /**
98
91
  */
@@ -109,11 +102,18 @@ export enum NextInputKind {
109
102
  }
110
103
  /**
111
104
  */
112
- export enum AvailableMoveKind {
113
- MonMove = 0,
114
- ManaMove = 1,
115
- Action = 2,
116
- Potion = 3,
105
+ export enum OutputModelKind {
106
+ InvalidInput = 0,
107
+ LocationsToStartFrom = 1,
108
+ NextInputOptions = 2,
109
+ Events = 3,
110
+ }
111
+ /**
112
+ */
113
+ export enum Consumable {
114
+ Potion = 0,
115
+ Bomb = 1,
116
+ BombOrPotion = 2,
117
117
  }
118
118
  /**
119
119
  */
@@ -230,6 +230,10 @@ export class MonsGameModel {
230
230
  */
231
231
  static from_fen(fen: string): MonsGameModel | undefined;
232
232
  /**
233
+ * @returns {MonsGameModel | undefined}
234
+ */
235
+ without_last_turn(): MonsGameModel | undefined;
236
+ /**
233
237
  * @returns {string}
234
238
  */
235
239
  fen(): string;
@@ -394,4 +398,8 @@ export class VerboseTrackingEntityModel {
394
398
  * @returns {(EventModel)[]}
395
399
  */
396
400
  events(): (EventModel)[];
401
+ /**
402
+ * @returns {string}
403
+ */
404
+ events_fen(): string;
397
405
  }
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.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
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.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
208
208
  /**
209
209
  */
210
- module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
210
+ 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", });
211
211
  /**
212
212
  */
213
- module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
213
+ module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
214
214
  /**
215
215
  */
216
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
216
+ 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", });
217
217
  /**
218
218
  */
219
- module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
219
+ 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", });
220
220
  /**
221
221
  */
222
- 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", });
222
+ 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", });
223
223
  /**
224
224
  */
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", });
225
+ module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
226
226
  /**
227
227
  */
228
- module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
228
+ 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", });
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.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
234
+ module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
235
235
 
236
236
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
237
237
  ? { register: () => {}, unregister: () => {} }
@@ -734,6 +734,13 @@ class MonsGameModel {
734
734
  return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
735
735
  }
736
736
  /**
737
+ * @returns {MonsGameModel | undefined}
738
+ */
739
+ without_last_turn() {
740
+ const ret = wasm.monsgamemodel_without_last_turn(this.__wbg_ptr);
741
+ return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
742
+ }
743
+ /**
737
744
  * @returns {string}
738
745
  */
739
746
  fen() {
@@ -1291,14 +1298,28 @@ class VerboseTrackingEntityModel {
1291
1298
  wasm.__wbindgen_add_to_stack_pointer(16);
1292
1299
  }
1293
1300
  }
1301
+ /**
1302
+ * @returns {string}
1303
+ */
1304
+ events_fen() {
1305
+ let deferred1_0;
1306
+ let deferred1_1;
1307
+ try {
1308
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1309
+ wasm.verbosetrackingentitymodel_events_fen(retptr, this.__wbg_ptr);
1310
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1311
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1312
+ deferred1_0 = r0;
1313
+ deferred1_1 = r1;
1314
+ return getStringFromWasm0(r0, r1);
1315
+ } finally {
1316
+ wasm.__wbindgen_add_to_stack_pointer(16);
1317
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1318
+ }
1319
+ }
1294
1320
  }
1295
1321
  module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
1296
1322
 
1297
- module.exports.__wbg_eventmodel_new = function(arg0) {
1298
- const ret = EventModel.__wrap(arg0);
1299
- return addHeapObject(ret);
1300
- };
1301
-
1302
1323
  module.exports.__wbg_location_new = function(arg0) {
1303
1324
  const ret = Location.__wrap(arg0);
1304
1325
  return addHeapObject(ret);
@@ -1309,6 +1330,11 @@ module.exports.__wbg_nextinputmodel_new = function(arg0) {
1309
1330
  return addHeapObject(ret);
1310
1331
  };
1311
1332
 
1333
+ module.exports.__wbg_eventmodel_new = function(arg0) {
1334
+ const ret = EventModel.__wrap(arg0);
1335
+ return addHeapObject(ret);
1336
+ };
1337
+
1312
1338
  module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1313
1339
  const ret = VerboseTrackingEntityModel.__wrap(arg0);
1314
1340
  return addHeapObject(ret);
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.56",
4
+ "version": "0.1.58",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",