mons-web 0.1.121 → 0.1.123
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 +57 -57
- package/mons-web.js +37 -38
- package/mons-web_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-web.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 ItemModelKind {
|
|
14
|
+
Mon = 0,
|
|
15
|
+
Mana = 1,
|
|
16
|
+
MonWithMana = 2,
|
|
17
|
+
MonWithConsumable = 3,
|
|
18
|
+
Consumable = 4,
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
*/
|
|
13
22
|
export enum Modifier {
|
|
14
23
|
SelectPotion = 0,
|
|
15
24
|
SelectBomb = 1,
|
|
@@ -17,32 +26,17 @@ export enum Modifier {
|
|
|
17
26
|
}
|
|
18
27
|
/**
|
|
19
28
|
*/
|
|
20
|
-
export enum
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
ManaPool = 4,
|
|
26
|
-
MonBase = 5,
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
*/
|
|
30
|
-
export enum Color {
|
|
31
|
-
White = 0,
|
|
32
|
-
Black = 1,
|
|
29
|
+
export enum OutputModelKind {
|
|
30
|
+
InvalidInput = 0,
|
|
31
|
+
LocationsToStartFrom = 1,
|
|
32
|
+
NextInputOptions = 2,
|
|
33
|
+
Events = 3,
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
*/
|
|
36
|
-
export enum
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
MysticAction = 2,
|
|
40
|
-
DemonAction = 3,
|
|
41
|
-
DemonAdditionalStep = 4,
|
|
42
|
-
SpiritTargetCapture = 5,
|
|
43
|
-
SpiritTargetMove = 6,
|
|
44
|
-
SelectConsumable = 7,
|
|
45
|
-
BombAttack = 8,
|
|
37
|
+
export enum ManaKind {
|
|
38
|
+
Regular = 0,
|
|
39
|
+
Supermana = 1,
|
|
46
40
|
}
|
|
47
41
|
/**
|
|
48
42
|
*/
|
|
@@ -54,35 +48,25 @@ export enum AvailableMoveKind {
|
|
|
54
48
|
}
|
|
55
49
|
/**
|
|
56
50
|
*/
|
|
57
|
-
export enum
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Angel = 2,
|
|
61
|
-
Spirit = 3,
|
|
62
|
-
Mystic = 4,
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
*/
|
|
66
|
-
export enum ManaKind {
|
|
67
|
-
Regular = 0,
|
|
68
|
-
Supermana = 1,
|
|
51
|
+
export enum Color {
|
|
52
|
+
White = 0,
|
|
53
|
+
Black = 1,
|
|
69
54
|
}
|
|
70
55
|
/**
|
|
71
56
|
*/
|
|
72
|
-
export enum
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Events = 3,
|
|
57
|
+
export enum Consumable {
|
|
58
|
+
Potion = 0,
|
|
59
|
+
Bomb = 1,
|
|
60
|
+
BombOrPotion = 2,
|
|
77
61
|
}
|
|
78
62
|
/**
|
|
79
63
|
*/
|
|
80
|
-
export enum
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
export enum MonKind {
|
|
65
|
+
Demon = 0,
|
|
66
|
+
Drainer = 1,
|
|
67
|
+
Angel = 2,
|
|
68
|
+
Spirit = 3,
|
|
69
|
+
Mystic = 4,
|
|
86
70
|
}
|
|
87
71
|
/**
|
|
88
72
|
*/
|
|
@@ -110,10 +94,26 @@ export enum EventModelKind {
|
|
|
110
94
|
}
|
|
111
95
|
/**
|
|
112
96
|
*/
|
|
113
|
-
export enum
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
97
|
+
export enum SquareModelKind {
|
|
98
|
+
Regular = 0,
|
|
99
|
+
ConsumableBase = 1,
|
|
100
|
+
SupermanaBase = 2,
|
|
101
|
+
ManaBase = 3,
|
|
102
|
+
ManaPool = 4,
|
|
103
|
+
MonBase = 5,
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
*/
|
|
107
|
+
export enum NextInputKind {
|
|
108
|
+
MonMove = 0,
|
|
109
|
+
ManaMove = 1,
|
|
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
|
*/
|
|
@@ -274,6 +274,11 @@ export class MonsGameModel {
|
|
|
274
274
|
*/
|
|
275
275
|
clearTracking(): void;
|
|
276
276
|
/**
|
|
277
|
+
* @param {string} preference
|
|
278
|
+
* @returns {OutputModel}
|
|
279
|
+
*/
|
|
280
|
+
smartAutomove(preference: string): OutputModel;
|
|
281
|
+
/**
|
|
277
282
|
* @returns {boolean}
|
|
278
283
|
*/
|
|
279
284
|
is_moves_verified(): boolean;
|
|
@@ -300,11 +305,6 @@ export class MonsGameModel {
|
|
|
300
305
|
*/
|
|
301
306
|
setVerboseTracking(enabled: boolean): void;
|
|
302
307
|
/**
|
|
303
|
-
* @param {string} preference
|
|
304
|
-
* @returns {Promise<any>}
|
|
305
|
-
*/
|
|
306
|
-
smartAutomoveAsync(preference: string): Promise<any>;
|
|
307
|
-
/**
|
|
308
308
|
* @returns {(Location)[]}
|
|
309
309
|
*/
|
|
310
310
|
locations_with_content(): (Location)[];
|
|
@@ -501,7 +501,7 @@ export interface InitOutput {
|
|
|
501
501
|
readonly monsgamemodel_process_input_fen: (a: number, b: number, c: number) => number;
|
|
502
502
|
readonly monsgamemodel_remove_item: (a: number, b: number) => void;
|
|
503
503
|
readonly monsgamemodel_setVerboseTracking: (a: number, b: number) => void;
|
|
504
|
-
readonly
|
|
504
|
+
readonly monsgamemodel_smartAutomove: (a: number, b: number, c: number, d: number) => void;
|
|
505
505
|
readonly monsgamemodel_square: (a: number, b: number) => number;
|
|
506
506
|
readonly monsgamemodel_takeback: (a: number) => number;
|
|
507
507
|
readonly monsgamemodel_takeback_fens: (a: number, b: number) => void;
|
|
@@ -522,7 +522,6 @@ export interface InitOutput {
|
|
|
522
522
|
readonly __wbg_get_nextinputmodel_location: (a: number) => number;
|
|
523
523
|
readonly __wbg_squaremodel_free: (a: number) => void;
|
|
524
524
|
readonly __wbg_set_nextinputmodel_location: (a: number, b: number) => void;
|
|
525
|
-
readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
526
525
|
readonly __wbg_get_mon_color: (a: number) => number;
|
|
527
526
|
readonly __wbg_get_mon_cooldown: (a: number) => number;
|
|
528
527
|
readonly __wbg_get_mon_kind: (a: number) => number;
|
|
@@ -540,6 +539,7 @@ export interface InitOutput {
|
|
|
540
539
|
readonly __wbg_set_location_i: (a: number, b: number) => void;
|
|
541
540
|
readonly __wbg_set_location_j: (a: number, b: number) => void;
|
|
542
541
|
readonly location_new: (a: number, b: number) => number;
|
|
542
|
+
readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
543
543
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
544
544
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
545
545
|
readonly __wbindgen_add_to_stack_pointer: (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
|
|
201
|
+
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", });
|
|
202
202
|
/**
|
|
203
203
|
*/
|
|
204
|
-
export const
|
|
204
|
+
export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
205
205
|
/**
|
|
206
206
|
*/
|
|
207
|
-
export const
|
|
207
|
+
export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
208
208
|
/**
|
|
209
209
|
*/
|
|
210
|
-
export const
|
|
210
|
+
export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
211
211
|
/**
|
|
212
212
|
*/
|
|
213
213
|
export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
214
214
|
/**
|
|
215
215
|
*/
|
|
216
|
-
export const
|
|
216
|
+
export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
217
217
|
/**
|
|
218
218
|
*/
|
|
219
|
-
export const
|
|
219
|
+
export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
220
220
|
/**
|
|
221
221
|
*/
|
|
222
|
-
export const
|
|
222
|
+
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", });
|
|
223
223
|
/**
|
|
224
224
|
*/
|
|
225
|
-
export const
|
|
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
|
|
228
|
+
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", });
|
|
229
229
|
/**
|
|
230
230
|
*/
|
|
231
|
-
export const
|
|
231
|
+
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", });
|
|
232
232
|
|
|
233
233
|
const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
234
234
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -815,6 +815,27 @@ export class MonsGameModel {
|
|
|
815
815
|
wasm.monsgamemodel_clearTracking(this.__wbg_ptr);
|
|
816
816
|
}
|
|
817
817
|
/**
|
|
818
|
+
* @param {string} preference
|
|
819
|
+
* @returns {OutputModel}
|
|
820
|
+
*/
|
|
821
|
+
smartAutomove(preference) {
|
|
822
|
+
try {
|
|
823
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
824
|
+
const ptr0 = passStringToWasm0(preference, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
825
|
+
const len0 = WASM_VECTOR_LEN;
|
|
826
|
+
wasm.monsgamemodel_smartAutomove(retptr, this.__wbg_ptr, ptr0, len0);
|
|
827
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
828
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
829
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
830
|
+
if (r2) {
|
|
831
|
+
throw takeObject(r1);
|
|
832
|
+
}
|
|
833
|
+
return OutputModel.__wrap(r0);
|
|
834
|
+
} finally {
|
|
835
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
818
839
|
* @returns {boolean}
|
|
819
840
|
*/
|
|
820
841
|
is_moves_verified() {
|
|
@@ -871,16 +892,6 @@ export class MonsGameModel {
|
|
|
871
892
|
wasm.monsgamemodel_setVerboseTracking(this.__wbg_ptr, enabled);
|
|
872
893
|
}
|
|
873
894
|
/**
|
|
874
|
-
* @param {string} preference
|
|
875
|
-
* @returns {Promise<any>}
|
|
876
|
-
*/
|
|
877
|
-
smartAutomoveAsync(preference) {
|
|
878
|
-
const ptr0 = passStringToWasm0(preference, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
879
|
-
const len0 = WASM_VECTOR_LEN;
|
|
880
|
-
const ret = wasm.monsgamemodel_smartAutomoveAsync(this.__wbg_ptr, ptr0, len0);
|
|
881
|
-
return takeObject(ret);
|
|
882
|
-
}
|
|
883
|
-
/**
|
|
884
895
|
* @returns {(Location)[]}
|
|
885
896
|
*/
|
|
886
897
|
locations_with_content() {
|
|
@@ -1405,30 +1416,26 @@ function __wbg_get_imports() {
|
|
|
1405
1416
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1406
1417
|
return addHeapObject(ret);
|
|
1407
1418
|
};
|
|
1408
|
-
imports.wbg.
|
|
1409
|
-
const ret =
|
|
1419
|
+
imports.wbg.__wbg_eventmodel_new = function(arg0) {
|
|
1420
|
+
const ret = EventModel.__wrap(arg0);
|
|
1410
1421
|
return addHeapObject(ret);
|
|
1411
1422
|
};
|
|
1412
1423
|
imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
|
|
1413
1424
|
const ret = NextInputModel.__wrap(arg0);
|
|
1414
1425
|
return addHeapObject(ret);
|
|
1415
1426
|
};
|
|
1416
|
-
imports.wbg.__wbg_eventmodel_new = function(arg0) {
|
|
1417
|
-
const ret = EventModel.__wrap(arg0);
|
|
1418
|
-
return addHeapObject(ret);
|
|
1419
|
-
};
|
|
1420
1427
|
imports.wbg.__wbg_location_new = function(arg0) {
|
|
1421
1428
|
const ret = Location.__wrap(arg0);
|
|
1422
1429
|
return addHeapObject(ret);
|
|
1423
1430
|
};
|
|
1424
|
-
imports.wbg.__wbg_verbosetrackingentitymodel_new = function(arg0) {
|
|
1425
|
-
const ret = VerboseTrackingEntityModel.__wrap(arg0);
|
|
1426
|
-
return addHeapObject(ret);
|
|
1427
|
-
};
|
|
1428
1431
|
imports.wbg.__wbg_location_unwrap = function(arg0) {
|
|
1429
1432
|
const ret = Location.__unwrap(takeObject(arg0));
|
|
1430
1433
|
return ret;
|
|
1431
1434
|
};
|
|
1435
|
+
imports.wbg.__wbg_verbosetrackingentitymodel_new = function(arg0) {
|
|
1436
|
+
const ret = VerboseTrackingEntityModel.__wrap(arg0);
|
|
1437
|
+
return addHeapObject(ret);
|
|
1438
|
+
};
|
|
1432
1439
|
imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
1433
1440
|
const ret = getObject(arg0).crypto;
|
|
1434
1441
|
return addHeapObject(ret);
|
|
@@ -1535,14 +1542,6 @@ function __wbg_get_imports() {
|
|
|
1535
1542
|
const ret = getObject(arg0);
|
|
1536
1543
|
return addHeapObject(ret);
|
|
1537
1544
|
};
|
|
1538
|
-
imports.wbg.__wbg_reject_a778418101c86bc9 = function(arg0) {
|
|
1539
|
-
const ret = Promise.reject(getObject(arg0));
|
|
1540
|
-
return addHeapObject(ret);
|
|
1541
|
-
};
|
|
1542
|
-
imports.wbg.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
|
|
1543
|
-
const ret = Promise.resolve(getObject(arg0));
|
|
1544
|
-
return addHeapObject(ret);
|
|
1545
|
-
};
|
|
1546
1545
|
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1547
1546
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1548
1547
|
return addHeapObject(ret);
|
package/mons-web_bg.wasm
CHANGED
|
Binary file
|