mons-rust 0.1.65 → 0.1.70

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,35 +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 EventModelKind {
14
- MonMove = 0,
15
- ManaMove = 1,
16
- ManaScored = 2,
17
- MysticAction = 3,
18
- DemonAction = 4,
19
- DemonAdditionalStep = 5,
20
- SpiritTargetMove = 6,
21
- PickupBomb = 7,
22
- PickupPotion = 8,
23
- PickupMana = 9,
24
- MonFainted = 10,
25
- ManaDropped = 11,
26
- SupermanaBackToBase = 12,
27
- BombAttack = 13,
28
- MonAwake = 14,
29
- BombExplosion = 15,
30
- NextTurn = 16,
31
- GameOver = 17,
32
- Takeback = 18,
33
- UsePotion = 19,
34
- }
35
- /**
36
- */
37
- export enum OutputModelKind {
38
- InvalidInput = 0,
39
- LocationsToStartFrom = 1,
40
- NextInputOptions = 2,
41
- Events = 3,
13
+ export enum MonKind {
14
+ Demon = 0,
15
+ Drainer = 1,
16
+ Angel = 2,
17
+ Spirit = 3,
18
+ Mystic = 4,
42
19
  }
43
20
  /**
44
21
  */
@@ -49,15 +26,6 @@ export enum Consumable {
49
26
  }
50
27
  /**
51
28
  */
52
- export enum ItemModelKind {
53
- Mon = 0,
54
- Mana = 1,
55
- MonWithMana = 2,
56
- MonWithConsumable = 3,
57
- Consumable = 4,
58
- }
59
- /**
60
- */
61
29
  export enum AvailableMoveKind {
62
30
  MonMove = 0,
63
31
  ManaMove = 1,
@@ -66,6 +34,16 @@ export enum AvailableMoveKind {
66
34
  }
67
35
  /**
68
36
  */
37
+ export enum SquareModelKind {
38
+ Regular = 0,
39
+ ConsumableBase = 1,
40
+ SupermanaBase = 2,
41
+ ManaBase = 3,
42
+ ManaPool = 4,
43
+ MonBase = 5,
44
+ }
45
+ /**
46
+ */
69
47
  export enum NextInputKind {
70
48
  MonMove = 0,
71
49
  ManaMove = 1,
@@ -79,25 +57,56 @@ export enum NextInputKind {
79
57
  }
80
58
  /**
81
59
  */
82
- export enum Color {
83
- White = 0,
84
- Black = 1,
60
+ export enum ItemModelKind {
61
+ Mon = 0,
62
+ Mana = 1,
63
+ MonWithMana = 2,
64
+ MonWithConsumable = 3,
65
+ Consumable = 4,
85
66
  }
86
67
  /**
87
68
  */
88
- export enum SquareModelKind {
69
+ export enum ManaKind {
89
70
  Regular = 0,
90
- ConsumableBase = 1,
91
- SupermanaBase = 2,
92
- ManaBase = 3,
93
- ManaPool = 4,
94
- MonBase = 5,
71
+ Supermana = 1,
95
72
  }
96
73
  /**
97
74
  */
98
- export enum ManaKind {
99
- Regular = 0,
100
- Supermana = 1,
75
+ export enum OutputModelKind {
76
+ InvalidInput = 0,
77
+ LocationsToStartFrom = 1,
78
+ NextInputOptions = 2,
79
+ Events = 3,
80
+ }
81
+ /**
82
+ */
83
+ export enum Color {
84
+ White = 0,
85
+ Black = 1,
86
+ }
87
+ /**
88
+ */
89
+ export enum EventModelKind {
90
+ MonMove = 0,
91
+ ManaMove = 1,
92
+ ManaScored = 2,
93
+ MysticAction = 3,
94
+ DemonAction = 4,
95
+ DemonAdditionalStep = 5,
96
+ SpiritTargetMove = 6,
97
+ PickupBomb = 7,
98
+ PickupPotion = 8,
99
+ PickupMana = 9,
100
+ MonFainted = 10,
101
+ ManaDropped = 11,
102
+ SupermanaBackToBase = 12,
103
+ BombAttack = 13,
104
+ MonAwake = 14,
105
+ BombExplosion = 15,
106
+ NextTurn = 16,
107
+ GameOver = 17,
108
+ Takeback = 18,
109
+ UsePotion = 19,
101
110
  }
102
111
  /**
103
112
  */
@@ -108,15 +117,6 @@ export enum Modifier {
108
117
  }
109
118
  /**
110
119
  */
111
- export enum MonKind {
112
- Demon = 0,
113
- Drainer = 1,
114
- Angel = 2,
115
- Spirit = 3,
116
- Mystic = 4,
117
- }
118
- /**
119
- */
120
120
  export class EventModel {
121
121
  free(): void;
122
122
  /**
@@ -271,6 +271,9 @@ export class MonsGameModel {
271
271
  */
272
272
  takeback_fens(): (string)[];
273
273
  /**
274
+ */
275
+ clearTracking(): void;
276
+ /**
274
277
  * @returns {OutputModel}
275
278
  */
276
279
  smart_automove(): OutputModel;
@@ -289,18 +292,37 @@ export class MonsGameModel {
289
292
  */
290
293
  without_last_turn(takeback_fens: (string)[]): MonsGameModel | undefined;
291
294
  /**
295
+ * @returns {MonsGameModel}
296
+ */
297
+ static newForSimulation(): MonsGameModel;
298
+ /**
292
299
  * @returns {Int32Array}
293
300
  */
294
301
  available_move_kinds(): Int32Array;
295
302
  /**
303
+ * @param {boolean} enabled
304
+ */
305
+ setVerboseTracking(enabled: boolean): void;
306
+ /**
296
307
  * @returns {(Location)[]}
297
308
  */
298
309
  locations_with_content(): (Location)[];
299
310
  /**
311
+ * @param {string} fen
312
+ * @returns {MonsGameModel | undefined}
313
+ */
314
+ static fromFenForSimulation(fen: string): MonsGameModel | undefined;
315
+ /**
300
316
  * @returns {(VerboseTrackingEntityModel)[]}
301
317
  */
302
318
  verbose_tracking_entities(): (VerboseTrackingEntityModel)[];
303
319
  /**
320
+ * @param {number} depth
321
+ * @param {number} max_visited_nodes
322
+ * @returns {OutputModel}
323
+ */
324
+ smartAutomoveWithBudget(depth: number, max_visited_nodes: number): OutputModel;
325
+ /**
304
326
  * @returns {Int32Array}
305
327
  */
306
328
  inactive_player_items_counters(): Int32Array;
package/mons-rust.js CHANGED
@@ -201,37 +201,37 @@ function handleError(f, args) {
201
201
  }
202
202
  /**
203
203
  */
204
- 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", });
205
- /**
206
- */
207
- module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
204
+ 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", });
208
205
  /**
209
206
  */
210
207
  module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
211
208
  /**
212
209
  */
213
- 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", });
210
+ module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
214
211
  /**
215
212
  */
216
- 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", });
217
214
  /**
218
215
  */
219
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", });
220
217
  /**
221
218
  */
222
- module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
219
+ 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
220
  /**
224
221
  */
225
- 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", });
222
+ module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
226
223
  /**
227
224
  */
228
- module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
225
+ module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
229
226
  /**
230
227
  */
231
- module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
228
+ module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
232
229
  /**
233
230
  */
234
- 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", });
231
+ 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", });
232
+ /**
233
+ */
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: () => {} }
@@ -651,14 +651,14 @@ class Mon {
651
651
  * @returns {number}
652
652
  */
653
653
  get cooldown() {
654
- const ret = wasm.__wbg_get_location_i(this.__wbg_ptr);
654
+ const ret = wasm.__wbg_get_mon_cooldown(this.__wbg_ptr);
655
655
  return ret;
656
656
  }
657
657
  /**
658
658
  * @param {number} arg0
659
659
  */
660
660
  set cooldown(arg0) {
661
- wasm.__wbg_set_location_i(this.__wbg_ptr, arg0);
661
+ wasm.__wbg_set_mon_cooldown(this.__wbg_ptr, arg0);
662
662
  }
663
663
  /**
664
664
  * @returns {boolean}
@@ -818,6 +818,11 @@ class MonsGameModel {
818
818
  }
819
819
  }
820
820
  /**
821
+ */
822
+ clearTracking() {
823
+ wasm.monsgamemodel_clearTracking(this.__wbg_ptr);
824
+ }
825
+ /**
821
826
  * @returns {OutputModel}
822
827
  */
823
828
  smart_automove() {
@@ -852,6 +857,13 @@ class MonsGameModel {
852
857
  return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
853
858
  }
854
859
  /**
860
+ * @returns {MonsGameModel}
861
+ */
862
+ static newForSimulation() {
863
+ const ret = wasm.monsgamemodel_newForSimulation();
864
+ return MonsGameModel.__wrap(ret);
865
+ }
866
+ /**
855
867
  * @returns {Int32Array}
856
868
  */
857
869
  available_move_kinds() {
@@ -868,6 +880,12 @@ class MonsGameModel {
868
880
  }
869
881
  }
870
882
  /**
883
+ * @param {boolean} enabled
884
+ */
885
+ setVerboseTracking(enabled) {
886
+ wasm.monsgamemodel_setVerboseTracking(this.__wbg_ptr, enabled);
887
+ }
888
+ /**
871
889
  * @returns {(Location)[]}
872
890
  */
873
891
  locations_with_content() {
@@ -884,6 +902,16 @@ class MonsGameModel {
884
902
  }
885
903
  }
886
904
  /**
905
+ * @param {string} fen
906
+ * @returns {MonsGameModel | undefined}
907
+ */
908
+ static fromFenForSimulation(fen) {
909
+ const ptr0 = passStringToWasm0(fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
910
+ const len0 = WASM_VECTOR_LEN;
911
+ const ret = wasm.monsgamemodel_fromFenForSimulation(ptr0, len0);
912
+ return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
913
+ }
914
+ /**
887
915
  * @returns {(VerboseTrackingEntityModel)[]}
888
916
  */
889
917
  verbose_tracking_entities() {
@@ -900,6 +928,15 @@ class MonsGameModel {
900
928
  }
901
929
  }
902
930
  /**
931
+ * @param {number} depth
932
+ * @param {number} max_visited_nodes
933
+ * @returns {OutputModel}
934
+ */
935
+ smartAutomoveWithBudget(depth, max_visited_nodes) {
936
+ const ret = wasm.monsgamemodel_smartAutomoveWithBudget(this.__wbg_ptr, depth, max_visited_nodes);
937
+ return OutputModel.__wrap(ret);
938
+ }
939
+ /**
903
940
  * @returns {Int32Array}
904
941
  */
905
942
  inactive_player_items_counters() {
@@ -1346,8 +1383,8 @@ class VerboseTrackingEntityModel {
1346
1383
  }
1347
1384
  module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
1348
1385
 
1349
- module.exports.__wbg_location_new = function(arg0) {
1350
- const ret = Location.__wrap(arg0);
1386
+ module.exports.__wbg_nextinputmodel_new = function(arg0) {
1387
+ const ret = NextInputModel.__wrap(arg0);
1351
1388
  return addHeapObject(ret);
1352
1389
  };
1353
1390
 
@@ -1356,8 +1393,8 @@ module.exports.__wbg_eventmodel_new = function(arg0) {
1356
1393
  return addHeapObject(ret);
1357
1394
  };
1358
1395
 
1359
- module.exports.__wbg_nextinputmodel_new = function(arg0) {
1360
- const ret = NextInputModel.__wrap(arg0);
1396
+ module.exports.__wbg_location_new = function(arg0) {
1397
+ const ret = Location.__wrap(arg0);
1361
1398
  return addHeapObject(ret);
1362
1399
  };
1363
1400
 
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.65",
4
+ "version": "0.1.70",
5
5
  "license": "CC0-1.0",
6
6
  "repository": {
7
7
  "type": "git",