mons-web 0.1.65 → 0.1.69

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-web.d.ts CHANGED
@@ -10,6 +10,23 @@
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 SquareModelKind {
14
+ Regular = 0,
15
+ ConsumableBase = 1,
16
+ SupermanaBase = 2,
17
+ ManaBase = 3,
18
+ ManaPool = 4,
19
+ MonBase = 5,
20
+ }
21
+ /**
22
+ */
23
+ export enum Consumable {
24
+ Potion = 0,
25
+ Bomb = 1,
26
+ BombOrPotion = 2,
27
+ }
28
+ /**
29
+ */
13
30
  export enum AvailableMoveKind {
14
31
  MonMove = 0,
15
32
  ManaMove = 1,
@@ -18,26 +35,21 @@ export enum AvailableMoveKind {
18
35
  }
19
36
  /**
20
37
  */
21
- export enum NextInputKind {
22
- MonMove = 0,
23
- ManaMove = 1,
24
- MysticAction = 2,
25
- DemonAction = 3,
26
- DemonAdditionalStep = 4,
27
- SpiritTargetCapture = 5,
28
- SpiritTargetMove = 6,
29
- SelectConsumable = 7,
30
- BombAttack = 8,
38
+ export enum ItemModelKind {
39
+ Mon = 0,
40
+ Mana = 1,
41
+ MonWithMana = 2,
42
+ MonWithConsumable = 3,
43
+ Consumable = 4,
31
44
  }
32
45
  /**
33
46
  */
34
- export enum SquareModelKind {
35
- Regular = 0,
36
- ConsumableBase = 1,
37
- SupermanaBase = 2,
38
- ManaBase = 3,
39
- ManaPool = 4,
40
- MonBase = 5,
47
+ export enum MonKind {
48
+ Demon = 0,
49
+ Drainer = 1,
50
+ Angel = 2,
51
+ Spirit = 3,
52
+ Mystic = 4,
41
53
  }
42
54
  /**
43
55
  */
@@ -61,22 +73,6 @@ export enum ManaKind {
61
73
  }
62
74
  /**
63
75
  */
64
- export enum ItemModelKind {
65
- Mon = 0,
66
- Mana = 1,
67
- MonWithMana = 2,
68
- MonWithConsumable = 3,
69
- Consumable = 4,
70
- }
71
- /**
72
- */
73
- export enum Modifier {
74
- SelectPotion = 0,
75
- SelectBomb = 1,
76
- Cancel = 2,
77
- }
78
- /**
79
- */
80
76
  export enum EventModelKind {
81
77
  MonMove = 0,
82
78
  ManaMove = 1,
@@ -101,19 +97,23 @@ export enum EventModelKind {
101
97
  }
102
98
  /**
103
99
  */
104
- export enum Consumable {
105
- Potion = 0,
106
- Bomb = 1,
107
- BombOrPotion = 2,
100
+ export enum NextInputKind {
101
+ MonMove = 0,
102
+ ManaMove = 1,
103
+ MysticAction = 2,
104
+ DemonAction = 3,
105
+ DemonAdditionalStep = 4,
106
+ SpiritTargetCapture = 5,
107
+ SpiritTargetMove = 6,
108
+ SelectConsumable = 7,
109
+ BombAttack = 8,
108
110
  }
109
111
  /**
110
112
  */
111
- export enum MonKind {
112
- Demon = 0,
113
- Drainer = 1,
114
- Angel = 2,
115
- Spirit = 3,
116
- Mystic = 4,
113
+ export enum Modifier {
114
+ SelectPotion = 0,
115
+ SelectBomb = 1,
116
+ Cancel = 2,
117
117
  }
118
118
  /**
119
119
  */
@@ -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;
@@ -469,7 +491,9 @@ export interface InitOutput {
469
491
  readonly monsgamemodel_available_move_kinds: (a: number, b: number) => void;
470
492
  readonly monsgamemodel_black_score: (a: number) => number;
471
493
  readonly monsgamemodel_can_takeback: (a: number, b: number) => number;
494
+ readonly monsgamemodel_clearTracking: (a: number) => void;
472
495
  readonly monsgamemodel_fen: (a: number, b: number) => void;
496
+ readonly monsgamemodel_fromFenForSimulation: (a: number, b: number) => number;
473
497
  readonly monsgamemodel_from_fen: (a: number, b: number) => number;
474
498
  readonly monsgamemodel_inactive_player_items_counters: (a: number, b: number) => void;
475
499
  readonly monsgamemodel_is_later_than: (a: number, b: number, c: number) => number;
@@ -477,9 +501,12 @@ export interface InitOutput {
477
501
  readonly monsgamemodel_item: (a: number, b: number) => number;
478
502
  readonly monsgamemodel_locations_with_content: (a: number, b: number) => void;
479
503
  readonly monsgamemodel_new: () => number;
504
+ readonly monsgamemodel_newForSimulation: () => number;
480
505
  readonly monsgamemodel_process_input: (a: number, b: number, c: number, d: number) => number;
481
506
  readonly monsgamemodel_process_input_fen: (a: number, b: number, c: number) => number;
482
507
  readonly monsgamemodel_remove_item: (a: number, b: number) => void;
508
+ readonly monsgamemodel_setVerboseTracking: (a: number, b: number) => void;
509
+ readonly monsgamemodel_smartAutomoveWithBudget: (a: number, b: number, c: number) => number;
483
510
  readonly monsgamemodel_smart_automove: (a: number) => number;
484
511
  readonly monsgamemodel_square: (a: number, b: number) => number;
485
512
  readonly monsgamemodel_takeback: (a: number) => number;
package/mons-web.js CHANGED
@@ -198,37 +198,37 @@ function handleError(f, args) {
198
198
  }
199
199
  /**
200
200
  */
201
- export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
201
+ export const 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", });
202
202
  /**
203
203
  */
204
- export const 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", });
204
+ export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
205
205
  /**
206
206
  */
207
- export const 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", });
207
+ export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
208
208
  /**
209
209
  */
210
- export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
210
+ export const ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
211
211
  /**
212
212
  */
213
- export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
213
+ export const 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
- export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
216
+ export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
217
217
  /**
218
218
  */
219
- export const ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
219
+ export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
220
220
  /**
221
221
  */
222
- export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
222
+ export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
223
223
  /**
224
224
  */
225
225
  export const 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
- export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
228
+ export const 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
- export const MonKind = Object.freeze({ Demon:0,"0":"Demon",Drainer:1,"1":"Drainer",Angel:2,"2":"Angel",Spirit:3,"3":"Spirit",Mystic:4,"4":"Mystic", });
231
+ export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
232
232
 
233
233
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
234
234
  ? { register: () => {}, unregister: () => {} }
@@ -810,6 +810,11 @@ export class MonsGameModel {
810
810
  }
811
811
  }
812
812
  /**
813
+ */
814
+ clearTracking() {
815
+ wasm.monsgamemodel_clearTracking(this.__wbg_ptr);
816
+ }
817
+ /**
813
818
  * @returns {OutputModel}
814
819
  */
815
820
  smart_automove() {
@@ -844,6 +849,13 @@ export class MonsGameModel {
844
849
  return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
845
850
  }
846
851
  /**
852
+ * @returns {MonsGameModel}
853
+ */
854
+ static newForSimulation() {
855
+ const ret = wasm.monsgamemodel_newForSimulation();
856
+ return MonsGameModel.__wrap(ret);
857
+ }
858
+ /**
847
859
  * @returns {Int32Array}
848
860
  */
849
861
  available_move_kinds() {
@@ -860,6 +872,12 @@ export class MonsGameModel {
860
872
  }
861
873
  }
862
874
  /**
875
+ * @param {boolean} enabled
876
+ */
877
+ setVerboseTracking(enabled) {
878
+ wasm.monsgamemodel_setVerboseTracking(this.__wbg_ptr, enabled);
879
+ }
880
+ /**
863
881
  * @returns {(Location)[]}
864
882
  */
865
883
  locations_with_content() {
@@ -876,6 +894,16 @@ export class MonsGameModel {
876
894
  }
877
895
  }
878
896
  /**
897
+ * @param {string} fen
898
+ * @returns {MonsGameModel | undefined}
899
+ */
900
+ static fromFenForSimulation(fen) {
901
+ const ptr0 = passStringToWasm0(fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
902
+ const len0 = WASM_VECTOR_LEN;
903
+ const ret = wasm.monsgamemodel_fromFenForSimulation(ptr0, len0);
904
+ return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
905
+ }
906
+ /**
879
907
  * @returns {(VerboseTrackingEntityModel)[]}
880
908
  */
881
909
  verbose_tracking_entities() {
@@ -892,6 +920,15 @@ export class MonsGameModel {
892
920
  }
893
921
  }
894
922
  /**
923
+ * @param {number} depth
924
+ * @param {number} max_visited_nodes
925
+ * @returns {OutputModel}
926
+ */
927
+ smartAutomoveWithBudget(depth, max_visited_nodes) {
928
+ const ret = wasm.monsgamemodel_smartAutomoveWithBudget(this.__wbg_ptr, depth, max_visited_nodes);
929
+ return OutputModel.__wrap(ret);
930
+ }
931
+ /**
895
932
  * @returns {Int32Array}
896
933
  */
897
934
  inactive_player_items_counters() {
@@ -1367,10 +1404,6 @@ async function __wbg_load(module, imports) {
1367
1404
  function __wbg_get_imports() {
1368
1405
  const imports = {};
1369
1406
  imports.wbg = {};
1370
- imports.wbg.__wbg_location_new = function(arg0) {
1371
- const ret = Location.__wrap(arg0);
1372
- return addHeapObject(ret);
1373
- };
1374
1407
  imports.wbg.__wbg_eventmodel_new = function(arg0) {
1375
1408
  const ret = EventModel.__wrap(arg0);
1376
1409
  return addHeapObject(ret);
@@ -1379,6 +1412,10 @@ function __wbg_get_imports() {
1379
1412
  const ret = NextInputModel.__wrap(arg0);
1380
1413
  return addHeapObject(ret);
1381
1414
  };
1415
+ imports.wbg.__wbg_location_new = function(arg0) {
1416
+ const ret = Location.__wrap(arg0);
1417
+ return addHeapObject(ret);
1418
+ };
1382
1419
  imports.wbg.__wbg_verbosetrackingentitymodel_new = function(arg0) {
1383
1420
  const ret = VerboseTrackingEntityModel.__wrap(arg0);
1384
1421
  return addHeapObject(ret);
package/mons-web_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mons-web",
3
3
  "type": "module",
4
4
  "description": "super metal mons",
5
- "version": "0.1.65",
5
+ "version": "0.1.69",
6
6
  "license": "CC0-1.0",
7
7
  "repository": {
8
8
  "type": "git",