mons-rust 0.1.85 → 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 +44 -49
- package/mons-rust.js +35 -41
- package/mons-rust_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-rust.d.ts
CHANGED
|
@@ -10,14 +10,6 @@
|
|
|
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 OutputModelKind {
|
|
14
|
-
InvalidInput = 0,
|
|
15
|
-
LocationsToStartFrom = 1,
|
|
16
|
-
NextInputOptions = 2,
|
|
17
|
-
Events = 3,
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
*/
|
|
21
13
|
export enum MonKind {
|
|
22
14
|
Demon = 0,
|
|
23
15
|
Drainer = 1,
|
|
@@ -27,6 +19,19 @@ export enum MonKind {
|
|
|
27
19
|
}
|
|
28
20
|
/**
|
|
29
21
|
*/
|
|
22
|
+
export enum NextInputKind {
|
|
23
|
+
MonMove = 0,
|
|
24
|
+
ManaMove = 1,
|
|
25
|
+
MysticAction = 2,
|
|
26
|
+
DemonAction = 3,
|
|
27
|
+
DemonAdditionalStep = 4,
|
|
28
|
+
SpiritTargetCapture = 5,
|
|
29
|
+
SpiritTargetMove = 6,
|
|
30
|
+
SelectConsumable = 7,
|
|
31
|
+
BombAttack = 8,
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
*/
|
|
30
35
|
export enum EventModelKind {
|
|
31
36
|
MonMove = 0,
|
|
32
37
|
ManaMove = 1,
|
|
@@ -51,32 +56,6 @@ export enum EventModelKind {
|
|
|
51
56
|
}
|
|
52
57
|
/**
|
|
53
58
|
*/
|
|
54
|
-
export enum Color {
|
|
55
|
-
White = 0,
|
|
56
|
-
Black = 1,
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
*/
|
|
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
|
-
export enum Modifier {
|
|
74
|
-
SelectPotion = 0,
|
|
75
|
-
SelectBomb = 1,
|
|
76
|
-
Cancel = 2,
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
*/
|
|
80
59
|
export enum ItemModelKind {
|
|
81
60
|
Mon = 0,
|
|
82
61
|
Mana = 1,
|
|
@@ -86,9 +65,11 @@ export enum ItemModelKind {
|
|
|
86
65
|
}
|
|
87
66
|
/**
|
|
88
67
|
*/
|
|
89
|
-
export enum
|
|
90
|
-
|
|
91
|
-
|
|
68
|
+
export enum AvailableMoveKind {
|
|
69
|
+
MonMove = 0,
|
|
70
|
+
ManaMove = 1,
|
|
71
|
+
Action = 2,
|
|
72
|
+
Potion = 3,
|
|
92
73
|
}
|
|
93
74
|
/**
|
|
94
75
|
*/
|
|
@@ -102,11 +83,15 @@ export enum SquareModelKind {
|
|
|
102
83
|
}
|
|
103
84
|
/**
|
|
104
85
|
*/
|
|
105
|
-
export enum
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
86
|
+
export enum Color {
|
|
87
|
+
White = 0,
|
|
88
|
+
Black = 1,
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
*/
|
|
92
|
+
export enum ManaKind {
|
|
93
|
+
Regular = 0,
|
|
94
|
+
Supermana = 1,
|
|
110
95
|
}
|
|
111
96
|
/**
|
|
112
97
|
*/
|
|
@@ -117,6 +102,21 @@ export enum Consumable {
|
|
|
117
102
|
}
|
|
118
103
|
/**
|
|
119
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.
|
|
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,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.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
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.
|
|
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
252
|
/**
|
|
253
253
|
*/
|
|
254
|
-
module.exports.
|
|
254
|
+
module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
255
255
|
/**
|
|
256
256
|
*/
|
|
257
|
-
module.exports.
|
|
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", });
|
|
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
263
|
module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
264
264
|
/**
|
|
265
265
|
*/
|
|
266
|
-
module.exports.
|
|
266
|
+
module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
267
267
|
/**
|
|
268
268
|
*/
|
|
269
|
-
module.exports.
|
|
269
|
+
module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
270
270
|
/**
|
|
271
271
|
*/
|
|
272
|
-
module.exports.
|
|
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
|
|
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,33 +1415,23 @@ class VerboseTrackingEntityModel {
|
|
|
1421
1415
|
}
|
|
1422
1416
|
module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
|
|
1423
1417
|
|
|
1424
|
-
module.exports.__wbg_eventmodel_new = function(arg0) {
|
|
1425
|
-
const ret = EventModel.__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);
|
|
1437
1421
|
};
|
|
1438
1422
|
|
|
1439
|
-
module.exports.
|
|
1440
|
-
const ret =
|
|
1423
|
+
module.exports.__wbg_eventmodel_new = function(arg0) {
|
|
1424
|
+
const ret = EventModel.__wrap(arg0);
|
|
1441
1425
|
return addHeapObject(ret);
|
|
1442
1426
|
};
|
|
1443
1427
|
|
|
1444
|
-
module.exports.
|
|
1445
|
-
const ret =
|
|
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.
|
|
1450
|
-
const ret =
|
|
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
|
|
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.
|
|
1659
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
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
|