mons-rust 0.1.84 → 0.1.86

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,51 +10,12 @@
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,
19
- }
20
- /**
21
- */
22
- export enum Consumable {
23
- Potion = 0,
24
- Bomb = 1,
25
- BombOrPotion = 2,
26
- }
27
- /**
28
- */
29
- export enum AvailableMoveKind {
30
- MonMove = 0,
31
- ManaMove = 1,
32
- Action = 2,
33
- Potion = 3,
34
- }
35
- /**
36
- */
37
- export enum OutputModelKind {
38
- InvalidInput = 0,
39
- LocationsToStartFrom = 1,
40
- NextInputOptions = 2,
41
- Events = 3,
42
- }
43
- /**
44
- */
45
- export enum SquareModelKind {
46
- Regular = 0,
47
- ConsumableBase = 1,
48
- SupermanaBase = 2,
49
- ManaBase = 3,
50
- ManaPool = 4,
51
- MonBase = 5,
52
- }
53
- /**
54
- */
55
- export enum Color {
56
- White = 0,
57
- Black = 1,
13
+ export enum MonKind {
14
+ Demon = 0,
15
+ Drainer = 1,
16
+ Angel = 2,
17
+ Spirit = 3,
18
+ Mystic = 4,
58
19
  }
59
20
  /**
60
21
  */
@@ -95,19 +56,36 @@ export enum EventModelKind {
95
56
  }
96
57
  /**
97
58
  */
98
- export enum Modifier {
99
- SelectPotion = 0,
100
- SelectBomb = 1,
101
- Cancel = 2,
59
+ export enum ItemModelKind {
60
+ Mon = 0,
61
+ Mana = 1,
62
+ MonWithMana = 2,
63
+ MonWithConsumable = 3,
64
+ Consumable = 4,
102
65
  }
103
66
  /**
104
67
  */
105
- export enum MonKind {
106
- Demon = 0,
107
- Drainer = 1,
108
- Angel = 2,
109
- Spirit = 3,
110
- Mystic = 4,
68
+ export enum AvailableMoveKind {
69
+ MonMove = 0,
70
+ ManaMove = 1,
71
+ Action = 2,
72
+ Potion = 3,
73
+ }
74
+ /**
75
+ */
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 Color {
87
+ White = 0,
88
+ Black = 1,
111
89
  }
112
90
  /**
113
91
  */
@@ -117,6 +95,28 @@ export enum ManaKind {
117
95
  }
118
96
  /**
119
97
  */
98
+ export enum Consumable {
99
+ Potion = 0,
100
+ Bomb = 1,
101
+ BombOrPotion = 2,
102
+ }
103
+ /**
104
+ */
105
+ export enum Modifier {
106
+ SelectPotion = 0,
107
+ SelectBomb = 1,
108
+ Cancel = 2,
109
+ }
110
+ /**
111
+ */
112
+ export enum OutputModelKind {
113
+ InvalidInput = 0,
114
+ LocationsToStartFrom = 1,
115
+ NextInputOptions = 2,
116
+ Events = 3,
117
+ }
118
+ /**
119
+ */
120
120
  export class EventModel {
121
121
  free(): void;
122
122
  /**
@@ -300,9 +300,10 @@ export class MonsGameModel {
300
300
  */
301
301
  setVerboseTracking(enabled: boolean): void;
302
302
  /**
303
+ * @param {string} preference
303
304
  * @returns {Promise<any>}
304
305
  */
305
- smartAutomoveAsync(): Promise<any>;
306
+ smartAutomoveAsync(preference: string): Promise<any>;
306
307
  /**
307
308
  * @returns {(Location)[]}
308
309
  */
@@ -321,12 +322,6 @@ export class MonsGameModel {
321
322
  */
322
323
  inactive_player_items_counters(): Int32Array;
323
324
  /**
324
- * @param {number} depth
325
- * @param {number} max_visited_nodes
326
- * @returns {Promise<any>}
327
- */
328
- smartAutomoveWithBudgetAsync(depth: number, max_visited_nodes: number): Promise<any>;
329
- /**
330
325
  * @returns {string}
331
326
  */
332
327
  fen(): string;
package/mons-rust.js CHANGED
@@ -150,7 +150,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
150
150
  return real;
151
151
  }
152
152
  function __wbg_adapter_26(arg0, arg1) {
153
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd118e63d1b16d9ab(arg0, arg1);
153
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h43a21085bd43f0c2(arg0, arg1);
154
154
  }
155
155
 
156
156
  let cachedUint32Memory0 = null;
@@ -233,22 +233,25 @@ function handleError(f, args) {
233
233
  wasm.__wbindgen_exn_store(addHeapObject(e));
234
234
  }
235
235
  }
236
- function __wbg_adapter_152(arg0, arg1, arg2, arg3) {
236
+ function __wbg_adapter_151(arg0, arg1, arg2, arg3) {
237
237
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h6cfc31b0a14c9fbd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
238
238
  }
239
239
 
240
240
  /**
241
241
  */
242
- 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", });
242
+ 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", });
243
243
  /**
244
244
  */
245
- module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
245
+ 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", });
246
246
  /**
247
247
  */
248
- module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
248
+ 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", });
249
249
  /**
250
250
  */
251
- module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
251
+ 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", });
252
+ /**
253
+ */
254
+ module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
252
255
  /**
253
256
  */
254
257
  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", });
@@ -257,19 +260,16 @@ module.exports.SquareModelKind = Object.freeze({ Regular:0,"0":"Regular",Consuma
257
260
  module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
258
261
  /**
259
262
  */
260
- 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", });
263
+ module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
261
264
  /**
262
265
  */
263
- 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", });
266
+ module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
264
267
  /**
265
268
  */
266
269
  module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
267
270
  /**
268
271
  */
269
- 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", });
270
- /**
271
- */
272
- module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
272
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
273
273
 
274
274
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
275
275
  ? { register: () => {}, unregister: () => {} }
@@ -917,10 +917,13 @@ class MonsGameModel {
917
917
  wasm.monsgamemodel_setVerboseTracking(this.__wbg_ptr, enabled);
918
918
  }
919
919
  /**
920
+ * @param {string} preference
920
921
  * @returns {Promise<any>}
921
922
  */
922
- smartAutomoveAsync() {
923
- const ret = wasm.monsgamemodel_smartAutomoveAsync(this.__wbg_ptr);
923
+ smartAutomoveAsync(preference) {
924
+ const ptr0 = passStringToWasm0(preference, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
925
+ const len0 = WASM_VECTOR_LEN;
926
+ const ret = wasm.monsgamemodel_smartAutomoveAsync(this.__wbg_ptr, ptr0, len0);
924
927
  return takeObject(ret);
925
928
  }
926
929
  /**
@@ -982,15 +985,6 @@ class MonsGameModel {
982
985
  }
983
986
  }
984
987
  /**
985
- * @param {number} depth
986
- * @param {number} max_visited_nodes
987
- * @returns {Promise<any>}
988
- */
989
- smartAutomoveWithBudgetAsync(depth, max_visited_nodes) {
990
- const ret = wasm.monsgamemodel_smartAutomoveWithBudgetAsync(this.__wbg_ptr, depth, max_visited_nodes);
991
- return takeObject(ret);
992
- }
993
- /**
994
988
  * @returns {string}
995
989
  */
996
990
  fen() {
@@ -1421,16 +1415,6 @@ class VerboseTrackingEntityModel {
1421
1415
  }
1422
1416
  module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
1423
1417
 
1424
- module.exports.__wbg_nextinputmodel_new = function(arg0) {
1425
- const ret = NextInputModel.__wrap(arg0);
1426
- return addHeapObject(ret);
1427
- };
1428
-
1429
- module.exports.__wbg_location_new = function(arg0) {
1430
- const ret = Location.__wrap(arg0);
1431
- return addHeapObject(ret);
1432
- };
1433
-
1434
1418
  module.exports.__wbindgen_number_new = function(arg0) {
1435
1419
  const ret = arg0;
1436
1420
  return addHeapObject(ret);
@@ -1441,13 +1425,13 @@ module.exports.__wbg_eventmodel_new = function(arg0) {
1441
1425
  return addHeapObject(ret);
1442
1426
  };
1443
1427
 
1444
- module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1445
- const ret = VerboseTrackingEntityModel.__wrap(arg0);
1428
+ module.exports.__wbg_nextinputmodel_new = function(arg0) {
1429
+ const ret = NextInputModel.__wrap(arg0);
1446
1430
  return addHeapObject(ret);
1447
1431
  };
1448
1432
 
1449
- module.exports.__wbg_outputmodel_new = function(arg0) {
1450
- const ret = OutputModel.__wrap(arg0);
1433
+ module.exports.__wbg_location_new = function(arg0) {
1434
+ const ret = Location.__wrap(arg0);
1451
1435
  return addHeapObject(ret);
1452
1436
  };
1453
1437
 
@@ -1480,6 +1464,16 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
1480
1464
  return ret;
1481
1465
  };
1482
1466
 
1467
+ module.exports.__wbg_outputmodel_new = function(arg0) {
1468
+ const ret = OutputModel.__wrap(arg0);
1469
+ return addHeapObject(ret);
1470
+ };
1471
+
1472
+ module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1473
+ const ret = VerboseTrackingEntityModel.__wrap(arg0);
1474
+ return addHeapObject(ret);
1475
+ };
1476
+
1483
1477
  module.exports.__wbg_location_unwrap = function(arg0) {
1484
1478
  const ret = Location.__unwrap(takeObject(arg0));
1485
1479
  return ret;
@@ -1614,7 +1608,7 @@ module.exports.__wbg_new_81740750da40724f = function(arg0, arg1) {
1614
1608
  const a = state0.a;
1615
1609
  state0.a = 0;
1616
1610
  try {
1617
- return __wbg_adapter_152(a, state0.b, arg0, arg1);
1611
+ return __wbg_adapter_151(a, state0.b, arg0, arg1);
1618
1612
  } finally {
1619
1613
  state0.a = a;
1620
1614
  }
@@ -1655,8 +1649,8 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
1655
1649
  throw new Error(getStringFromWasm0(arg0, arg1));
1656
1650
  };
1657
1651
 
1658
- module.exports.__wbindgen_closure_wrapper306 = function(arg0, arg1, arg2) {
1659
- const ret = makeMutClosure(arg0, arg1, 11, __wbg_adapter_26);
1652
+ module.exports.__wbindgen_closure_wrapper303 = function(arg0, arg1, arg2) {
1653
+ const ret = makeMutClosure(arg0, arg1, 16, __wbg_adapter_26);
1660
1654
  return addHeapObject(ret);
1661
1655
  };
1662
1656
 
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.84",
4
+ "version": "0.1.86",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",