mons-rust 0.1.61 → 0.1.62

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,12 +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 ItemModelKind {
14
- Mon = 0,
15
- Mana = 1,
16
- MonWithMana = 2,
17
- MonWithConsumable = 3,
18
- Consumable = 4,
13
+ export enum OutputModelKind {
14
+ InvalidInput = 0,
15
+ LocationsToStartFrom = 1,
16
+ NextInputOptions = 2,
17
+ Events = 3,
18
+ }
19
+ /**
20
+ */
21
+ export enum ManaKind {
22
+ Regular = 0,
23
+ Supermana = 1,
19
24
  }
20
25
  /**
21
26
  */
@@ -28,6 +33,16 @@ export enum MonKind {
28
33
  }
29
34
  /**
30
35
  */
36
+ export enum SquareModelKind {
37
+ Regular = 0,
38
+ ConsumableBase = 1,
39
+ SupermanaBase = 2,
40
+ ManaBase = 3,
41
+ ManaPool = 4,
42
+ MonBase = 5,
43
+ }
44
+ /**
45
+ */
31
46
  export enum NextInputKind {
32
47
  MonMove = 0,
33
48
  ManaMove = 1,
@@ -41,35 +56,25 @@ export enum NextInputKind {
41
56
  }
42
57
  /**
43
58
  */
44
- export enum AvailableMoveKind {
45
- MonMove = 0,
46
- ManaMove = 1,
47
- Action = 2,
48
- Potion = 3,
49
- }
50
- /**
51
- */
52
- export enum Consumable {
53
- Potion = 0,
54
- Bomb = 1,
55
- BombOrPotion = 2,
59
+ export enum Modifier {
60
+ SelectPotion = 0,
61
+ SelectBomb = 1,
62
+ Cancel = 2,
56
63
  }
57
64
  /**
58
65
  */
59
- export enum SquareModelKind {
60
- Regular = 0,
61
- ConsumableBase = 1,
62
- SupermanaBase = 2,
63
- ManaBase = 3,
64
- ManaPool = 4,
65
- MonBase = 5,
66
+ export enum ItemModelKind {
67
+ Mon = 0,
68
+ Mana = 1,
69
+ MonWithMana = 2,
70
+ MonWithConsumable = 3,
71
+ Consumable = 4,
66
72
  }
67
73
  /**
68
74
  */
69
- export enum Modifier {
70
- SelectPotion = 0,
71
- SelectBomb = 1,
72
- Cancel = 2,
75
+ export enum Color {
76
+ White = 0,
77
+ Black = 1,
73
78
  }
74
79
  /**
75
80
  */
@@ -97,23 +102,18 @@ export enum EventModelKind {
97
102
  }
98
103
  /**
99
104
  */
100
- export enum ManaKind {
101
- Regular = 0,
102
- Supermana = 1,
103
- }
104
- /**
105
- */
106
- export enum OutputModelKind {
107
- InvalidInput = 0,
108
- LocationsToStartFrom = 1,
109
- NextInputOptions = 2,
110
- Events = 3,
105
+ export enum AvailableMoveKind {
106
+ MonMove = 0,
107
+ ManaMove = 1,
108
+ Action = 2,
109
+ Potion = 3,
111
110
  }
112
111
  /**
113
112
  */
114
- export enum Color {
115
- White = 0,
116
- Black = 1,
113
+ export enum Consumable {
114
+ Potion = 0,
115
+ Bomb = 1,
116
+ BombOrPotion = 2,
117
117
  }
118
118
  /**
119
119
  */
@@ -230,9 +230,10 @@ export class MonsGameModel {
230
230
  */
231
231
  static from_fen(fen: string): MonsGameModel | undefined;
232
232
  /**
233
+ * @param {(string)[]} takeback_fens
233
234
  * @returns {MonsGameModel | undefined}
234
235
  */
235
- without_last_turn(): MonsGameModel | undefined;
236
+ without_last_turn(takeback_fens: (string)[]): MonsGameModel | undefined;
236
237
  /**
237
238
  * @returns {string}
238
239
  */
package/mons-rust.js CHANGED
@@ -106,6 +106,10 @@ function passStringToWasm0(arg, malloc, realloc) {
106
106
  return ptr;
107
107
  }
108
108
 
109
+ function isLikeNone(x) {
110
+ return x === undefined || x === null;
111
+ }
112
+
109
113
  let cachedInt32Memory0 = null;
110
114
 
111
115
  function getInt32Memory0() {
@@ -134,10 +138,6 @@ function passArrayJsValueToWasm0(array, malloc) {
134
138
  return ptr;
135
139
  }
136
140
 
137
- function isLikeNone(x) {
138
- return x === undefined || x === null;
139
- }
140
-
141
141
  function _assertClass(instance, klass) {
142
142
  if (!(instance instanceof klass)) {
143
143
  throw new Error(`expected instance of ${klass.name}`);
@@ -201,37 +201,37 @@ function handleError(f, args) {
201
201
  }
202
202
  /**
203
203
  */
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", });
204
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
205
205
  /**
206
206
  */
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", });
207
+ module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
208
208
  /**
209
209
  */
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", });
210
+ 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", });
211
211
  /**
212
212
  */
213
- module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
213
+ 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", });
214
214
  /**
215
215
  */
216
- module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
216
+ 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", });
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.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
220
220
  /**
221
221
  */
222
- module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
222
+ 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", });
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.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
226
226
  /**
227
227
  */
228
- module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
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", });
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.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
232
232
  /**
233
233
  */
234
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
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,10 +734,13 @@ class MonsGameModel {
734
734
  return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
735
735
  }
736
736
  /**
737
+ * @param {(string)[]} takeback_fens
737
738
  * @returns {MonsGameModel | undefined}
738
739
  */
739
- without_last_turn() {
740
- const ret = wasm.monsgamemodel_without_last_turn(this.__wbg_ptr);
740
+ without_last_turn(takeback_fens) {
741
+ const ptr0 = passArrayJsValueToWasm0(takeback_fens, wasm.__wbindgen_malloc);
742
+ const len0 = WASM_VECTOR_LEN;
743
+ const ret = wasm.monsgamemodel_without_last_turn(this.__wbg_ptr, ptr0, len0);
741
744
  return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
742
745
  }
743
746
  /**
@@ -1336,11 +1339,6 @@ class VerboseTrackingEntityModel {
1336
1339
  }
1337
1340
  module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
1338
1341
 
1339
- module.exports.__wbg_location_new = function(arg0) {
1340
- const ret = Location.__wrap(arg0);
1341
- return addHeapObject(ret);
1342
- };
1343
-
1344
1342
  module.exports.__wbg_eventmodel_new = function(arg0) {
1345
1343
  const ret = EventModel.__wrap(arg0);
1346
1344
  return addHeapObject(ret);
@@ -1351,6 +1349,11 @@ module.exports.__wbg_nextinputmodel_new = function(arg0) {
1351
1349
  return addHeapObject(ret);
1352
1350
  };
1353
1351
 
1352
+ module.exports.__wbg_location_new = function(arg0) {
1353
+ const ret = Location.__wrap(arg0);
1354
+ return addHeapObject(ret);
1355
+ };
1356
+
1354
1357
  module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1355
1358
  const ret = VerboseTrackingEntityModel.__wrap(arg0);
1356
1359
  return addHeapObject(ret);
@@ -1434,6 +1437,15 @@ module.exports.__wbg_call_27c0f87801dedf93 = function() { return handleError(fun
1434
1437
  return addHeapObject(ret);
1435
1438
  }, arguments) };
1436
1439
 
1440
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
1441
+ const obj = getObject(arg1);
1442
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1443
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1444
+ var len1 = WASM_VECTOR_LEN;
1445
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
1446
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
1447
+ };
1448
+
1437
1449
  module.exports.__wbindgen_object_clone_ref = function(arg0) {
1438
1450
  const ret = getObject(arg0);
1439
1451
  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.61",
4
+ "version": "0.1.62",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",