mons-rust 0.1.55 → 0.1.57

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,33 +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 AvailableMoveKind {
14
- MonMove = 0,
15
- ManaMove = 1,
16
- Action = 2,
17
- Potion = 3,
18
- }
19
- /**
20
- */
21
- export enum ManaKind {
22
- Regular = 0,
23
- Supermana = 1,
24
- }
25
- /**
26
- */
27
- export enum Consumable {
28
- Potion = 0,
29
- Bomb = 1,
30
- BombOrPotion = 2,
31
- }
32
- /**
33
- */
34
- export enum Color {
35
- White = 0,
36
- Black = 1,
37
- }
38
- /**
39
- */
40
13
  export enum ItemModelKind {
41
14
  Mon = 0,
42
15
  Mana = 1,
@@ -46,29 +19,9 @@ export enum ItemModelKind {
46
19
  }
47
20
  /**
48
21
  */
49
- export enum SquareModelKind {
22
+ export enum ManaKind {
50
23
  Regular = 0,
51
- ConsumableBase = 1,
52
- SupermanaBase = 2,
53
- ManaBase = 3,
54
- ManaPool = 4,
55
- MonBase = 5,
56
- }
57
- /**
58
- */
59
- export enum MonKind {
60
- Demon = 0,
61
- Drainer = 1,
62
- Angel = 2,
63
- Spirit = 3,
64
- Mystic = 4,
65
- }
66
- /**
67
- */
68
- export enum Modifier {
69
- SelectPotion = 0,
70
- SelectBomb = 1,
71
- Cancel = 2,
24
+ Supermana = 1,
72
25
  }
73
26
  /**
74
27
  */
@@ -96,6 +49,35 @@ export enum EventModelKind {
96
49
  }
97
50
  /**
98
51
  */
52
+ export enum MonKind {
53
+ Demon = 0,
54
+ Drainer = 1,
55
+ Angel = 2,
56
+ Spirit = 3,
57
+ Mystic = 4,
58
+ }
59
+ /**
60
+ */
61
+ export enum Modifier {
62
+ SelectPotion = 0,
63
+ SelectBomb = 1,
64
+ Cancel = 2,
65
+ }
66
+ /**
67
+ */
68
+ export enum Consumable {
69
+ Potion = 0,
70
+ Bomb = 1,
71
+ BombOrPotion = 2,
72
+ }
73
+ /**
74
+ */
75
+ export enum Color {
76
+ White = 0,
77
+ Black = 1,
78
+ }
79
+ /**
80
+ */
99
81
  export enum OutputModelKind {
100
82
  InvalidInput = 0,
101
83
  LocationsToStartFrom = 1,
@@ -117,6 +99,24 @@ export enum NextInputKind {
117
99
  }
118
100
  /**
119
101
  */
102
+ export enum SquareModelKind {
103
+ Regular = 0,
104
+ ConsumableBase = 1,
105
+ SupermanaBase = 2,
106
+ ManaBase = 3,
107
+ ManaPool = 4,
108
+ MonBase = 5,
109
+ }
110
+ /**
111
+ */
112
+ export enum AvailableMoveKind {
113
+ MonMove = 0,
114
+ ManaMove = 1,
115
+ Action = 2,
116
+ Potion = 3,
117
+ }
118
+ /**
119
+ */
120
120
  export class EventModel {
121
121
  free(): void;
122
122
  /**
@@ -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;
@@ -322,6 +326,10 @@ export class MonsGameModel {
322
326
  * @returns {(Location)[]}
323
327
  */
324
328
  locations_with_content(): (Location)[];
329
+ /**
330
+ * @returns {(VerboseTrackingEntityModel)[]}
331
+ */
332
+ verbose_tracking_entities(): (VerboseTrackingEntityModel)[];
325
333
  }
326
334
  /**
327
335
  */
@@ -378,3 +386,16 @@ export class SquareModel {
378
386
  */
379
387
  mon_kind?: MonKind;
380
388
  }
389
+ /**
390
+ */
391
+ export class VerboseTrackingEntityModel {
392
+ free(): void;
393
+ /**
394
+ * @returns {string}
395
+ */
396
+ fen(): string;
397
+ /**
398
+ * @returns {(EventModel)[]}
399
+ */
400
+ events(): (EventModel)[];
401
+ }
package/mons-rust.js CHANGED
@@ -201,37 +201,37 @@ function handleError(f, args) {
201
201
  }
202
202
  /**
203
203
  */
204
- module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
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
207
  module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
208
208
  /**
209
209
  */
210
- module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
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", });
211
211
  /**
212
212
  */
213
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
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", });
214
214
  /**
215
215
  */
216
- 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", });
216
+ module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
217
217
  /**
218
218
  */
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", });
219
+ module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
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.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
223
223
  /**
224
224
  */
225
- module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
225
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
226
226
  /**
227
227
  */
228
- 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", });
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.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
231
+ 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", });
232
232
  /**
233
233
  */
234
- 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", });
234
+ module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
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() {
@@ -943,6 +950,22 @@ class MonsGameModel {
943
950
  wasm.__wbindgen_add_to_stack_pointer(16);
944
951
  }
945
952
  }
953
+ /**
954
+ * @returns {(VerboseTrackingEntityModel)[]}
955
+ */
956
+ verbose_tracking_entities() {
957
+ try {
958
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
959
+ wasm.monsgamemodel_verbose_tracking_entities(retptr, this.__wbg_ptr);
960
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
961
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
962
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
963
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
964
+ return v1;
965
+ } finally {
966
+ wasm.__wbindgen_add_to_stack_pointer(16);
967
+ }
968
+ }
946
969
  }
947
970
  module.exports.MonsGameModel = MonsGameModel;
948
971
 
@@ -1214,6 +1237,75 @@ class SquareModel {
1214
1237
  }
1215
1238
  module.exports.SquareModel = SquareModel;
1216
1239
 
1240
+ const VerboseTrackingEntityModelFinalization = (typeof FinalizationRegistry === 'undefined')
1241
+ ? { register: () => {}, unregister: () => {} }
1242
+ : new FinalizationRegistry(ptr => wasm.__wbg_verbosetrackingentitymodel_free(ptr >>> 0));
1243
+ /**
1244
+ */
1245
+ class VerboseTrackingEntityModel {
1246
+
1247
+ static __wrap(ptr) {
1248
+ ptr = ptr >>> 0;
1249
+ const obj = Object.create(VerboseTrackingEntityModel.prototype);
1250
+ obj.__wbg_ptr = ptr;
1251
+ VerboseTrackingEntityModelFinalization.register(obj, obj.__wbg_ptr, obj);
1252
+ return obj;
1253
+ }
1254
+
1255
+ __destroy_into_raw() {
1256
+ const ptr = this.__wbg_ptr;
1257
+ this.__wbg_ptr = 0;
1258
+ VerboseTrackingEntityModelFinalization.unregister(this);
1259
+ return ptr;
1260
+ }
1261
+
1262
+ free() {
1263
+ const ptr = this.__destroy_into_raw();
1264
+ wasm.__wbg_verbosetrackingentitymodel_free(ptr);
1265
+ }
1266
+ /**
1267
+ * @returns {string}
1268
+ */
1269
+ fen() {
1270
+ let deferred1_0;
1271
+ let deferred1_1;
1272
+ try {
1273
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1274
+ wasm.verbosetrackingentitymodel_fen(retptr, this.__wbg_ptr);
1275
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1276
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1277
+ deferred1_0 = r0;
1278
+ deferred1_1 = r1;
1279
+ return getStringFromWasm0(r0, r1);
1280
+ } finally {
1281
+ wasm.__wbindgen_add_to_stack_pointer(16);
1282
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1283
+ }
1284
+ }
1285
+ /**
1286
+ * @returns {(EventModel)[]}
1287
+ */
1288
+ events() {
1289
+ try {
1290
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1291
+ wasm.verbosetrackingentitymodel_events(retptr, this.__wbg_ptr);
1292
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1293
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1294
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1295
+ wasm.__wbindgen_free(r0, r1 * 4, 4);
1296
+ return v1;
1297
+ } finally {
1298
+ wasm.__wbindgen_add_to_stack_pointer(16);
1299
+ }
1300
+ }
1301
+ }
1302
+ module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
1303
+
1304
+ module.exports.__wbg_nextinputmodel_new = function(arg0) {
1305
+ const ret = NextInputModel.__wrap(arg0);
1306
+ return addHeapObject(ret);
1307
+ };
1308
+
1217
1309
  module.exports.__wbg_location_new = function(arg0) {
1218
1310
  const ret = Location.__wrap(arg0);
1219
1311
  return addHeapObject(ret);
@@ -1224,8 +1316,8 @@ module.exports.__wbg_eventmodel_new = function(arg0) {
1224
1316
  return addHeapObject(ret);
1225
1317
  };
1226
1318
 
1227
- module.exports.__wbg_nextinputmodel_new = function(arg0) {
1228
- const ret = NextInputModel.__wrap(arg0);
1319
+ module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1320
+ const ret = VerboseTrackingEntityModel.__wrap(arg0);
1229
1321
  return addHeapObject(ret);
1230
1322
  };
1231
1323
 
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.55",
4
+ "version": "0.1.57",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",