mons-rust 0.1.120 → 0.1.122

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
@@ -16,29 +16,35 @@ export enum ManaKind {
16
16
  }
17
17
  /**
18
18
  */
19
- export enum MonKind {
20
- Demon = 0,
21
- Drainer = 1,
22
- Angel = 2,
23
- Spirit = 3,
24
- Mystic = 4,
19
+ export enum AvailableMoveKind {
20
+ MonMove = 0,
21
+ ManaMove = 1,
22
+ Action = 2,
23
+ Potion = 3,
25
24
  }
26
25
  /**
27
26
  */
28
- export enum SquareModelKind {
29
- Regular = 0,
30
- ConsumableBase = 1,
31
- SupermanaBase = 2,
32
- ManaBase = 3,
33
- ManaPool = 4,
34
- MonBase = 5,
27
+ export enum OutputModelKind {
28
+ InvalidInput = 0,
29
+ LocationsToStartFrom = 1,
30
+ NextInputOptions = 2,
31
+ Events = 3,
35
32
  }
36
33
  /**
37
34
  */
38
- export enum Modifier {
39
- SelectPotion = 0,
40
- SelectBomb = 1,
41
- Cancel = 2,
35
+ export enum Consumable {
36
+ Potion = 0,
37
+ Bomb = 1,
38
+ BombOrPotion = 2,
39
+ }
40
+ /**
41
+ */
42
+ export enum MonKind {
43
+ Demon = 0,
44
+ Drainer = 1,
45
+ Angel = 2,
46
+ Spirit = 3,
47
+ Mystic = 4,
42
48
  }
43
49
  /**
44
50
  */
@@ -55,6 +61,16 @@ export enum NextInputKind {
55
61
  }
56
62
  /**
57
63
  */
64
+ export enum SquareModelKind {
65
+ Regular = 0,
66
+ ConsumableBase = 1,
67
+ SupermanaBase = 2,
68
+ ManaBase = 3,
69
+ ManaPool = 4,
70
+ MonBase = 5,
71
+ }
72
+ /**
73
+ */
58
74
  export enum EventModelKind {
59
75
  MonMove = 0,
60
76
  ManaMove = 1,
@@ -79,11 +95,9 @@ export enum EventModelKind {
79
95
  }
80
96
  /**
81
97
  */
82
- export enum OutputModelKind {
83
- InvalidInput = 0,
84
- LocationsToStartFrom = 1,
85
- NextInputOptions = 2,
86
- Events = 3,
98
+ export enum Color {
99
+ White = 0,
100
+ Black = 1,
87
101
  }
88
102
  /**
89
103
  */
@@ -96,24 +110,10 @@ export enum ItemModelKind {
96
110
  }
97
111
  /**
98
112
  */
99
- export enum Consumable {
100
- Potion = 0,
101
- Bomb = 1,
102
- BombOrPotion = 2,
103
- }
104
- /**
105
- */
106
- export enum Color {
107
- White = 0,
108
- Black = 1,
109
- }
110
- /**
111
- */
112
- export enum AvailableMoveKind {
113
- MonMove = 0,
114
- ManaMove = 1,
115
- Action = 2,
116
- Potion = 3,
113
+ export enum Modifier {
114
+ SelectPotion = 0,
115
+ SelectBomb = 1,
116
+ Cancel = 2,
117
117
  }
118
118
  /**
119
119
  */
@@ -274,6 +274,11 @@ export class MonsGameModel {
274
274
  */
275
275
  clearTracking(): void;
276
276
  /**
277
+ * @param {string} preference
278
+ * @returns {OutputModel}
279
+ */
280
+ smartAutomove(preference: string): OutputModel;
281
+ /**
277
282
  * @returns {boolean}
278
283
  */
279
284
  is_moves_verified(): boolean;
@@ -300,11 +305,6 @@ export class MonsGameModel {
300
305
  */
301
306
  setVerboseTracking(enabled: boolean): void;
302
307
  /**
303
- * @param {string} preference
304
- * @returns {Promise<any>}
305
- */
306
- smartAutomoveAsync(preference: string): Promise<any>;
307
- /**
308
308
  * @returns {(Location)[]}
309
309
  */
310
310
  locations_with_content(): (Location)[];
package/mons-rust.js CHANGED
@@ -204,34 +204,34 @@ function handleError(f, args) {
204
204
  module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
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.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.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", });
210
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
211
211
  /**
212
212
  */
213
- module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
213
+ module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
214
214
  /**
215
215
  */
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", });
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.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", });
219
+ 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", });
220
220
  /**
221
221
  */
222
- module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
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.ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
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.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
229
229
  /**
230
230
  */
231
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
231
+ 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", });
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.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
235
235
 
236
236
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
237
237
  ? { register: () => {}, unregister: () => {} }
@@ -823,6 +823,27 @@ class MonsGameModel {
823
823
  wasm.monsgamemodel_clearTracking(this.__wbg_ptr);
824
824
  }
825
825
  /**
826
+ * @param {string} preference
827
+ * @returns {OutputModel}
828
+ */
829
+ smartAutomove(preference) {
830
+ try {
831
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
832
+ const ptr0 = passStringToWasm0(preference, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
833
+ const len0 = WASM_VECTOR_LEN;
834
+ wasm.monsgamemodel_smartAutomove(retptr, this.__wbg_ptr, ptr0, len0);
835
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
836
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
837
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
838
+ if (r2) {
839
+ throw takeObject(r1);
840
+ }
841
+ return OutputModel.__wrap(r0);
842
+ } finally {
843
+ wasm.__wbindgen_add_to_stack_pointer(16);
844
+ }
845
+ }
846
+ /**
826
847
  * @returns {boolean}
827
848
  */
828
849
  is_moves_verified() {
@@ -879,16 +900,6 @@ class MonsGameModel {
879
900
  wasm.monsgamemodel_setVerboseTracking(this.__wbg_ptr, enabled);
880
901
  }
881
902
  /**
882
- * @param {string} preference
883
- * @returns {Promise<any>}
884
- */
885
- smartAutomoveAsync(preference) {
886
- const ptr0 = passStringToWasm0(preference, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
887
- const len0 = WASM_VECTOR_LEN;
888
- const ret = wasm.monsgamemodel_smartAutomoveAsync(this.__wbg_ptr, ptr0, len0);
889
- return takeObject(ret);
890
- }
891
- /**
892
903
  * @returns {(Location)[]}
893
904
  */
894
905
  locations_with_content() {
@@ -1386,16 +1397,6 @@ module.exports.__wbindgen_string_new = function(arg0, arg1) {
1386
1397
  return addHeapObject(ret);
1387
1398
  };
1388
1399
 
1389
- module.exports.__wbg_outputmodel_new = function(arg0) {
1390
- const ret = OutputModel.__wrap(arg0);
1391
- return addHeapObject(ret);
1392
- };
1393
-
1394
- module.exports.__wbg_nextinputmodel_new = function(arg0) {
1395
- const ret = NextInputModel.__wrap(arg0);
1396
- return addHeapObject(ret);
1397
- };
1398
-
1399
1400
  module.exports.__wbg_location_new = function(arg0) {
1400
1401
  const ret = Location.__wrap(arg0);
1401
1402
  return addHeapObject(ret);
@@ -1406,6 +1407,11 @@ module.exports.__wbg_eventmodel_new = function(arg0) {
1406
1407
  return addHeapObject(ret);
1407
1408
  };
1408
1409
 
1410
+ module.exports.__wbg_nextinputmodel_new = function(arg0) {
1411
+ const ret = NextInputModel.__wrap(arg0);
1412
+ return addHeapObject(ret);
1413
+ };
1414
+
1409
1415
  module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1410
1416
  const ret = VerboseTrackingEntityModel.__wrap(arg0);
1411
1417
  return addHeapObject(ret);
@@ -1548,16 +1554,6 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
1548
1554
  return addHeapObject(ret);
1549
1555
  };
1550
1556
 
1551
- module.exports.__wbg_reject_a778418101c86bc9 = function(arg0) {
1552
- const ret = Promise.reject(getObject(arg0));
1553
- return addHeapObject(ret);
1554
- };
1555
-
1556
- module.exports.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
1557
- const ret = Promise.resolve(getObject(arg0));
1558
- return addHeapObject(ret);
1559
- };
1560
-
1561
1557
  module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
1562
1558
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
1563
1559
  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.120",
4
+ "version": "0.1.122",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",