mons-web 0.1.121 → 0.1.122
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 +60 -60
- package/mons-web.js +34 -35
- package/mons-web_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-web.d.ts
CHANGED
|
@@ -10,6 +10,39 @@
|
|
|
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
|
+
*/
|
|
22
|
+
export enum EventModelKind {
|
|
23
|
+
MonMove = 0,
|
|
24
|
+
ManaMove = 1,
|
|
25
|
+
ManaScored = 2,
|
|
26
|
+
MysticAction = 3,
|
|
27
|
+
DemonAction = 4,
|
|
28
|
+
DemonAdditionalStep = 5,
|
|
29
|
+
SpiritTargetMove = 6,
|
|
30
|
+
PickupBomb = 7,
|
|
31
|
+
PickupPotion = 8,
|
|
32
|
+
PickupMana = 9,
|
|
33
|
+
MonFainted = 10,
|
|
34
|
+
ManaDropped = 11,
|
|
35
|
+
SupermanaBackToBase = 12,
|
|
36
|
+
BombAttack = 13,
|
|
37
|
+
MonAwake = 14,
|
|
38
|
+
BombExplosion = 15,
|
|
39
|
+
NextTurn = 16,
|
|
40
|
+
GameOver = 17,
|
|
41
|
+
Takeback = 18,
|
|
42
|
+
UsePotion = 19,
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
*/
|
|
13
46
|
export enum Modifier {
|
|
14
47
|
SelectPotion = 0,
|
|
15
48
|
SelectBomb = 1,
|
|
@@ -17,19 +50,9 @@ export enum Modifier {
|
|
|
17
50
|
}
|
|
18
51
|
/**
|
|
19
52
|
*/
|
|
20
|
-
export enum
|
|
53
|
+
export enum ManaKind {
|
|
21
54
|
Regular = 0,
|
|
22
|
-
|
|
23
|
-
SupermanaBase = 2,
|
|
24
|
-
ManaBase = 3,
|
|
25
|
-
ManaPool = 4,
|
|
26
|
-
MonBase = 5,
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
*/
|
|
30
|
-
export enum Color {
|
|
31
|
-
White = 0,
|
|
32
|
-
Black = 1,
|
|
55
|
+
Supermana = 1,
|
|
33
56
|
}
|
|
34
57
|
/**
|
|
35
58
|
*/
|
|
@@ -46,14 +69,6 @@ export enum NextInputKind {
|
|
|
46
69
|
}
|
|
47
70
|
/**
|
|
48
71
|
*/
|
|
49
|
-
export enum AvailableMoveKind {
|
|
50
|
-
MonMove = 0,
|
|
51
|
-
ManaMove = 1,
|
|
52
|
-
Action = 2,
|
|
53
|
-
Potion = 3,
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
*/
|
|
57
72
|
export enum MonKind {
|
|
58
73
|
Demon = 0,
|
|
59
74
|
Drainer = 1,
|
|
@@ -63,9 +78,17 @@ export enum MonKind {
|
|
|
63
78
|
}
|
|
64
79
|
/**
|
|
65
80
|
*/
|
|
66
|
-
export enum
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
export enum AvailableMoveKind {
|
|
82
|
+
MonMove = 0,
|
|
83
|
+
ManaMove = 1,
|
|
84
|
+
Action = 2,
|
|
85
|
+
Potion = 3,
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
*/
|
|
89
|
+
export enum Color {
|
|
90
|
+
White = 0,
|
|
91
|
+
Black = 1,
|
|
69
92
|
}
|
|
70
93
|
/**
|
|
71
94
|
*/
|
|
@@ -77,36 +100,13 @@ export enum OutputModelKind {
|
|
|
77
100
|
}
|
|
78
101
|
/**
|
|
79
102
|
*/
|
|
80
|
-
export enum
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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,
|
|
103
|
+
export enum SquareModelKind {
|
|
104
|
+
Regular = 0,
|
|
105
|
+
ConsumableBase = 1,
|
|
106
|
+
SupermanaBase = 2,
|
|
107
|
+
ManaBase = 3,
|
|
108
|
+
ManaPool = 4,
|
|
109
|
+
MonBase = 5,
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
*/
|
|
@@ -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;
|
|
@@ -534,6 +533,7 @@ export interface InitOutput {
|
|
|
534
533
|
readonly mon_faint: (a: number) => void;
|
|
535
534
|
readonly mon_is_fainted: (a: number) => number;
|
|
536
535
|
readonly mon_new: (a: number, b: number, c: number) => number;
|
|
536
|
+
readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
537
537
|
readonly __wbg_get_location_i: (a: number) => number;
|
|
538
538
|
readonly __wbg_get_location_j: (a: number) => number;
|
|
539
539
|
readonly __wbg_location_free: (a: number) => void;
|
package/mons-web.js
CHANGED
|
@@ -198,34 +198,34 @@ 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 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
205
|
/**
|
|
206
206
|
*/
|
|
207
|
-
export const
|
|
207
|
+
export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
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
|
-
export const
|
|
213
|
+
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", });
|
|
214
214
|
/**
|
|
215
215
|
*/
|
|
216
216
|
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", });
|
|
217
217
|
/**
|
|
218
218
|
*/
|
|
219
|
-
export const
|
|
219
|
+
export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
220
220
|
/**
|
|
221
221
|
*/
|
|
222
|
-
export const
|
|
222
|
+
export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
223
223
|
/**
|
|
224
224
|
*/
|
|
225
|
-
export const
|
|
225
|
+
export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
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
231
|
export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
@@ -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,20 +1416,16 @@ function __wbg_get_imports() {
|
|
|
1405
1416
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1406
1417
|
return addHeapObject(ret);
|
|
1407
1418
|
};
|
|
1408
|
-
imports.wbg.
|
|
1409
|
-
const ret =
|
|
1410
|
-
return addHeapObject(ret);
|
|
1411
|
-
};
|
|
1412
|
-
imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
|
|
1413
|
-
const ret = NextInputModel.__wrap(arg0);
|
|
1419
|
+
imports.wbg.__wbg_location_new = function(arg0) {
|
|
1420
|
+
const ret = Location.__wrap(arg0);
|
|
1414
1421
|
return addHeapObject(ret);
|
|
1415
1422
|
};
|
|
1416
1423
|
imports.wbg.__wbg_eventmodel_new = function(arg0) {
|
|
1417
1424
|
const ret = EventModel.__wrap(arg0);
|
|
1418
1425
|
return addHeapObject(ret);
|
|
1419
1426
|
};
|
|
1420
|
-
imports.wbg.
|
|
1421
|
-
const ret =
|
|
1427
|
+
imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
|
|
1428
|
+
const ret = NextInputModel.__wrap(arg0);
|
|
1422
1429
|
return addHeapObject(ret);
|
|
1423
1430
|
};
|
|
1424
1431
|
imports.wbg.__wbg_verbosetrackingentitymodel_new = function(arg0) {
|
|
@@ -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
|