mons-rust 0.1.85 → 0.1.87
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 +47 -52
- package/mons-rust.js +39 -40
- package/mons-rust_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-rust.d.ts
CHANGED
|
@@ -10,6 +10,15 @@
|
|
|
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 MonKind {
|
|
14
|
+
Demon = 0,
|
|
15
|
+
Drainer = 1,
|
|
16
|
+
Angel = 2,
|
|
17
|
+
Spirit = 3,
|
|
18
|
+
Mystic = 4,
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
*/
|
|
13
22
|
export enum OutputModelKind {
|
|
14
23
|
InvalidInput = 0,
|
|
15
24
|
LocationsToStartFrom = 1,
|
|
@@ -18,12 +27,28 @@ export enum OutputModelKind {
|
|
|
18
27
|
}
|
|
19
28
|
/**
|
|
20
29
|
*/
|
|
21
|
-
export enum
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
export enum SquareModelKind {
|
|
31
|
+
Regular = 0,
|
|
32
|
+
ConsumableBase = 1,
|
|
33
|
+
SupermanaBase = 2,
|
|
34
|
+
ManaBase = 3,
|
|
35
|
+
ManaPool = 4,
|
|
36
|
+
MonBase = 5,
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
*/
|
|
40
|
+
export enum AvailableMoveKind {
|
|
41
|
+
MonMove = 0,
|
|
42
|
+
ManaMove = 1,
|
|
43
|
+
Action = 2,
|
|
44
|
+
Potion = 3,
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
*/
|
|
48
|
+
export enum Consumable {
|
|
49
|
+
Potion = 0,
|
|
50
|
+
Bomb = 1,
|
|
51
|
+
BombOrPotion = 2,
|
|
27
52
|
}
|
|
28
53
|
/**
|
|
29
54
|
*/
|
|
@@ -57,19 +82,6 @@ export enum Color {
|
|
|
57
82
|
}
|
|
58
83
|
/**
|
|
59
84
|
*/
|
|
60
|
-
export enum NextInputKind {
|
|
61
|
-
MonMove = 0,
|
|
62
|
-
ManaMove = 1,
|
|
63
|
-
MysticAction = 2,
|
|
64
|
-
DemonAction = 3,
|
|
65
|
-
DemonAdditionalStep = 4,
|
|
66
|
-
SpiritTargetCapture = 5,
|
|
67
|
-
SpiritTargetMove = 6,
|
|
68
|
-
SelectConsumable = 7,
|
|
69
|
-
BombAttack = 8,
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
*/
|
|
73
85
|
export enum Modifier {
|
|
74
86
|
SelectPotion = 0,
|
|
75
87
|
SelectBomb = 1,
|
|
@@ -77,43 +89,31 @@ export enum Modifier {
|
|
|
77
89
|
}
|
|
78
90
|
/**
|
|
79
91
|
*/
|
|
80
|
-
export enum ItemModelKind {
|
|
81
|
-
Mon = 0,
|
|
82
|
-
Mana = 1,
|
|
83
|
-
MonWithMana = 2,
|
|
84
|
-
MonWithConsumable = 3,
|
|
85
|
-
Consumable = 4,
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
*/
|
|
89
92
|
export enum ManaKind {
|
|
90
93
|
Regular = 0,
|
|
91
94
|
Supermana = 1,
|
|
92
95
|
}
|
|
93
96
|
/**
|
|
94
97
|
*/
|
|
95
|
-
export enum
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
MonBase = 5,
|
|
98
|
+
export enum ItemModelKind {
|
|
99
|
+
Mon = 0,
|
|
100
|
+
Mana = 1,
|
|
101
|
+
MonWithMana = 2,
|
|
102
|
+
MonWithConsumable = 3,
|
|
103
|
+
Consumable = 4,
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
104
106
|
*/
|
|
105
|
-
export enum
|
|
107
|
+
export enum NextInputKind {
|
|
106
108
|
MonMove = 0,
|
|
107
109
|
ManaMove = 1,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Bomb = 1,
|
|
116
|
-
BombOrPotion = 2,
|
|
110
|
+
MysticAction = 2,
|
|
111
|
+
DemonAction = 3,
|
|
112
|
+
DemonAdditionalStep = 4,
|
|
113
|
+
SpiritTargetCapture = 5,
|
|
114
|
+
SpiritTargetMove = 6,
|
|
115
|
+
SelectConsumable = 7,
|
|
116
|
+
BombAttack = 8,
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
*/
|
|
@@ -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.
|
|
153
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3151ce4ea0fab8cd(arg0, arg1);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
let cachedUint32Memory0 = null;
|
|
@@ -233,43 +233,43 @@ function handleError(f, args) {
|
|
|
233
233
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
function
|
|
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.
|
|
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.
|
|
245
|
+
module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
246
246
|
/**
|
|
247
247
|
*/
|
|
248
|
-
module.exports.
|
|
248
|
+
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", });
|
|
249
249
|
/**
|
|
250
250
|
*/
|
|
251
|
-
module.exports.
|
|
251
|
+
module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
252
252
|
/**
|
|
253
253
|
*/
|
|
254
|
-
module.exports.
|
|
254
|
+
module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
255
255
|
/**
|
|
256
256
|
*/
|
|
257
|
-
module.exports.
|
|
257
|
+
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", });
|
|
258
258
|
/**
|
|
259
259
|
*/
|
|
260
|
-
module.exports.
|
|
260
|
+
module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
261
261
|
/**
|
|
262
262
|
*/
|
|
263
|
-
module.exports.
|
|
263
|
+
module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
264
264
|
/**
|
|
265
265
|
*/
|
|
266
|
-
module.exports.
|
|
266
|
+
module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
267
267
|
/**
|
|
268
268
|
*/
|
|
269
|
-
module.exports.
|
|
269
|
+
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", });
|
|
270
270
|
/**
|
|
271
271
|
*/
|
|
272
|
-
module.exports.
|
|
272
|
+
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", });
|
|
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
|
|
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,8 +1415,8 @@ class VerboseTrackingEntityModel {
|
|
|
1421
1415
|
}
|
|
1422
1416
|
module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
|
|
1423
1417
|
|
|
1424
|
-
module.exports.
|
|
1425
|
-
const ret =
|
|
1418
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
|
1419
|
+
const ret = arg0;
|
|
1426
1420
|
return addHeapObject(ret);
|
|
1427
1421
|
};
|
|
1428
1422
|
|
|
@@ -1431,23 +1425,13 @@ module.exports.__wbg_location_new = function(arg0) {
|
|
|
1431
1425
|
return addHeapObject(ret);
|
|
1432
1426
|
};
|
|
1433
1427
|
|
|
1434
|
-
module.exports.__wbindgen_number_new = function(arg0) {
|
|
1435
|
-
const ret = arg0;
|
|
1436
|
-
return addHeapObject(ret);
|
|
1437
|
-
};
|
|
1438
|
-
|
|
1439
1428
|
module.exports.__wbg_nextinputmodel_new = function(arg0) {
|
|
1440
1429
|
const ret = NextInputModel.__wrap(arg0);
|
|
1441
1430
|
return addHeapObject(ret);
|
|
1442
1431
|
};
|
|
1443
1432
|
|
|
1444
|
-
module.exports.
|
|
1445
|
-
const ret =
|
|
1446
|
-
return addHeapObject(ret);
|
|
1447
|
-
};
|
|
1448
|
-
|
|
1449
|
-
module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
|
|
1450
|
-
const ret = VerboseTrackingEntityModel.__wrap(arg0);
|
|
1433
|
+
module.exports.__wbg_eventmodel_new = function(arg0) {
|
|
1434
|
+
const ret = EventModel.__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
|
|
1611
|
+
return __wbg_adapter_151(a, state0.b, arg0, arg1);
|
|
1618
1612
|
} finally {
|
|
1619
1613
|
state0.a = a;
|
|
1620
1614
|
}
|
|
@@ -1631,6 +1625,11 @@ module.exports.__wbg_reject_a778418101c86bc9 = function(arg0) {
|
|
|
1631
1625
|
return addHeapObject(ret);
|
|
1632
1626
|
};
|
|
1633
1627
|
|
|
1628
|
+
module.exports.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
|
|
1629
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
1630
|
+
return addHeapObject(ret);
|
|
1631
|
+
};
|
|
1632
|
+
|
|
1634
1633
|
module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1635
1634
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1636
1635
|
return addHeapObject(ret);
|
|
@@ -1656,7 +1655,7 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
|
1656
1655
|
};
|
|
1657
1656
|
|
|
1658
1657
|
module.exports.__wbindgen_closure_wrapper306 = function(arg0, arg1, arg2) {
|
|
1659
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1658
|
+
const ret = makeMutClosure(arg0, arg1, 16, __wbg_adapter_26);
|
|
1660
1659
|
return addHeapObject(ret);
|
|
1661
1660
|
};
|
|
1662
1661
|
|
package/mons-rust_bg.wasm
CHANGED
|
Binary file
|