mons-web 0.1.127 → 0.1.129
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 +65 -52
- package/mons-web.js +23 -18
- package/mons-web_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-web.d.ts
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
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 ManaKind {
|
|
14
|
+
Regular = 0,
|
|
15
|
+
Supermana = 1,
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
*/
|
|
13
19
|
export enum SquareModelKind {
|
|
14
20
|
Regular = 0,
|
|
15
21
|
ConsumableBase = 1,
|
|
@@ -20,46 +26,20 @@ export enum SquareModelKind {
|
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
22
28
|
*/
|
|
23
|
-
export enum
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/
|
|
29
|
-
export enum Modifier {
|
|
30
|
-
SelectPotion = 0,
|
|
31
|
-
SelectBomb = 1,
|
|
32
|
-
Cancel = 2,
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
*/
|
|
36
|
-
export enum Color {
|
|
37
|
-
White = 0,
|
|
38
|
-
Black = 1,
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
*/
|
|
42
|
-
export enum Consumable {
|
|
43
|
-
Potion = 0,
|
|
44
|
-
Bomb = 1,
|
|
45
|
-
BombOrPotion = 2,
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
*/
|
|
49
|
-
export enum ItemModelKind {
|
|
50
|
-
Mon = 0,
|
|
51
|
-
Mana = 1,
|
|
52
|
-
MonWithMana = 2,
|
|
53
|
-
MonWithConsumable = 3,
|
|
54
|
-
Consumable = 4,
|
|
29
|
+
export enum AvailableMoveKind {
|
|
30
|
+
MonMove = 0,
|
|
31
|
+
ManaMove = 1,
|
|
32
|
+
Action = 2,
|
|
33
|
+
Potion = 3,
|
|
55
34
|
}
|
|
56
35
|
/**
|
|
57
36
|
*/
|
|
58
|
-
export enum
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
37
|
+
export enum MonKind {
|
|
38
|
+
Demon = 0,
|
|
39
|
+
Drainer = 1,
|
|
40
|
+
Angel = 2,
|
|
41
|
+
Spirit = 3,
|
|
42
|
+
Mystic = 4,
|
|
63
43
|
}
|
|
64
44
|
/**
|
|
65
45
|
*/
|
|
@@ -87,6 +67,30 @@ export enum EventModelKind {
|
|
|
87
67
|
}
|
|
88
68
|
/**
|
|
89
69
|
*/
|
|
70
|
+
export enum OutputModelKind {
|
|
71
|
+
InvalidInput = 0,
|
|
72
|
+
LocationsToStartFrom = 1,
|
|
73
|
+
NextInputOptions = 2,
|
|
74
|
+
Events = 3,
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
*/
|
|
78
|
+
export enum Modifier {
|
|
79
|
+
SelectPotion = 0,
|
|
80
|
+
SelectBomb = 1,
|
|
81
|
+
Cancel = 2,
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
*/
|
|
85
|
+
export enum ItemModelKind {
|
|
86
|
+
Mon = 0,
|
|
87
|
+
Mana = 1,
|
|
88
|
+
MonWithMana = 2,
|
|
89
|
+
MonWithConsumable = 3,
|
|
90
|
+
Consumable = 4,
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
*/
|
|
90
94
|
export enum NextInputKind {
|
|
91
95
|
MonMove = 0,
|
|
92
96
|
ManaMove = 1,
|
|
@@ -100,20 +104,27 @@ export enum NextInputKind {
|
|
|
100
104
|
}
|
|
101
105
|
/**
|
|
102
106
|
*/
|
|
103
|
-
export enum
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Spirit = 3,
|
|
108
|
-
Mystic = 4,
|
|
107
|
+
export enum Consumable {
|
|
108
|
+
Potion = 0,
|
|
109
|
+
Bomb = 1,
|
|
110
|
+
BombOrPotion = 2,
|
|
109
111
|
}
|
|
110
112
|
/**
|
|
111
113
|
*/
|
|
112
|
-
export enum
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
export enum GameVariant {
|
|
115
|
+
Classic = 0,
|
|
116
|
+
SwappedManaRows = 1,
|
|
117
|
+
OffsetArcManaRows = 2,
|
|
118
|
+
CenterSpokeManaRows = 3,
|
|
119
|
+
AlternatingManaRows = 4,
|
|
120
|
+
InnerWedgeManaRows = 5,
|
|
121
|
+
OuterWedgeManaRows = 6,
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
*/
|
|
125
|
+
export enum Color {
|
|
126
|
+
White = 0,
|
|
127
|
+
Black = 1,
|
|
117
128
|
}
|
|
118
129
|
/**
|
|
119
130
|
*/
|
|
@@ -293,9 +304,10 @@ export class MonsGameModel {
|
|
|
293
304
|
*/
|
|
294
305
|
without_last_turn(takeback_fens: (string)[]): MonsGameModel | undefined;
|
|
295
306
|
/**
|
|
307
|
+
* @param {GameVariant} variant
|
|
296
308
|
* @returns {MonsGameModel}
|
|
297
309
|
*/
|
|
298
|
-
static newForSimulation(): MonsGameModel;
|
|
310
|
+
static newForSimulation(variant: GameVariant): MonsGameModel;
|
|
299
311
|
/**
|
|
300
312
|
* @returns {Int32Array}
|
|
301
313
|
*/
|
|
@@ -326,9 +338,10 @@ export class MonsGameModel {
|
|
|
326
338
|
*/
|
|
327
339
|
fen(): string;
|
|
328
340
|
/**
|
|
341
|
+
* @param {GameVariant} variant
|
|
329
342
|
* @returns {MonsGameModel}
|
|
330
343
|
*/
|
|
331
|
-
static new(): MonsGameModel;
|
|
344
|
+
static new(variant: GameVariant): MonsGameModel;
|
|
332
345
|
/**
|
|
333
346
|
* @param {Location} at
|
|
334
347
|
* @returns {ItemModel | undefined}
|
|
@@ -495,8 +508,8 @@ export interface InitOutput {
|
|
|
495
508
|
readonly monsgamemodel_is_moves_verified: (a: number) => number;
|
|
496
509
|
readonly monsgamemodel_item: (a: number, b: number) => number;
|
|
497
510
|
readonly monsgamemodel_locations_with_content: (a: number, b: number) => void;
|
|
498
|
-
readonly monsgamemodel_new: () => number;
|
|
499
|
-
readonly monsgamemodel_newForSimulation: () => number;
|
|
511
|
+
readonly monsgamemodel_new: (a: number) => number;
|
|
512
|
+
readonly monsgamemodel_newForSimulation: (a: number) => number;
|
|
500
513
|
readonly monsgamemodel_process_input: (a: number, b: number, c: number, d: number) => number;
|
|
501
514
|
readonly monsgamemodel_process_input_fen: (a: number, b: number, c: number) => number;
|
|
502
515
|
readonly monsgamemodel_remove_item: (a: number, b: number) => void;
|
package/mons-web.js
CHANGED
|
@@ -198,37 +198,40 @@ function handleError(f, args) {
|
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
200
|
*/
|
|
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
|
-
/**
|
|
203
|
-
*/
|
|
204
201
|
export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
205
202
|
/**
|
|
206
203
|
*/
|
|
207
|
-
export const
|
|
204
|
+
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", });
|
|
208
205
|
/**
|
|
209
206
|
*/
|
|
210
|
-
export const
|
|
207
|
+
export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
211
208
|
/**
|
|
212
209
|
*/
|
|
213
|
-
export const
|
|
210
|
+
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
211
|
/**
|
|
215
212
|
*/
|
|
216
|
-
export const
|
|
213
|
+
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", });
|
|
217
214
|
/**
|
|
218
215
|
*/
|
|
219
216
|
export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
220
217
|
/**
|
|
221
218
|
*/
|
|
222
|
-
export const
|
|
219
|
+
export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
220
|
+
/**
|
|
221
|
+
*/
|
|
222
|
+
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", });
|
|
223
223
|
/**
|
|
224
224
|
*/
|
|
225
225
|
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", });
|
|
226
226
|
/**
|
|
227
227
|
*/
|
|
228
|
-
export const
|
|
228
|
+
export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
229
229
|
/**
|
|
230
230
|
*/
|
|
231
|
-
export const
|
|
231
|
+
export const GameVariant = Object.freeze({ Classic:0,"0":"Classic",SwappedManaRows:1,"1":"SwappedManaRows",OffsetArcManaRows:2,"2":"OffsetArcManaRows",CenterSpokeManaRows:3,"3":"CenterSpokeManaRows",AlternatingManaRows:4,"4":"AlternatingManaRows",InnerWedgeManaRows:5,"5":"InnerWedgeManaRows",OuterWedgeManaRows:6,"6":"OuterWedgeManaRows", });
|
|
232
|
+
/**
|
|
233
|
+
*/
|
|
234
|
+
export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
232
235
|
|
|
233
236
|
const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
234
237
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -863,10 +866,11 @@ export class MonsGameModel {
|
|
|
863
866
|
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
864
867
|
}
|
|
865
868
|
/**
|
|
869
|
+
* @param {GameVariant} variant
|
|
866
870
|
* @returns {MonsGameModel}
|
|
867
871
|
*/
|
|
868
|
-
static newForSimulation() {
|
|
869
|
-
const ret = wasm.monsgamemodel_newForSimulation();
|
|
872
|
+
static newForSimulation(variant) {
|
|
873
|
+
const ret = wasm.monsgamemodel_newForSimulation(variant);
|
|
870
874
|
return MonsGameModel.__wrap(ret);
|
|
871
875
|
}
|
|
872
876
|
/**
|
|
@@ -969,10 +973,11 @@ export class MonsGameModel {
|
|
|
969
973
|
}
|
|
970
974
|
}
|
|
971
975
|
/**
|
|
976
|
+
* @param {GameVariant} variant
|
|
972
977
|
* @returns {MonsGameModel}
|
|
973
978
|
*/
|
|
974
|
-
static new() {
|
|
975
|
-
const ret = wasm.monsgamemodel_new();
|
|
979
|
+
static new(variant) {
|
|
980
|
+
const ret = wasm.monsgamemodel_new(variant);
|
|
976
981
|
return MonsGameModel.__wrap(ret);
|
|
977
982
|
}
|
|
978
983
|
/**
|
|
@@ -1416,14 +1421,14 @@ function __wbg_get_imports() {
|
|
|
1416
1421
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1417
1422
|
return addHeapObject(ret);
|
|
1418
1423
|
};
|
|
1419
|
-
imports.wbg.__wbg_location_new = function(arg0) {
|
|
1420
|
-
const ret = Location.__wrap(arg0);
|
|
1421
|
-
return addHeapObject(ret);
|
|
1422
|
-
};
|
|
1423
1424
|
imports.wbg.__wbg_eventmodel_new = function(arg0) {
|
|
1424
1425
|
const ret = EventModel.__wrap(arg0);
|
|
1425
1426
|
return addHeapObject(ret);
|
|
1426
1427
|
};
|
|
1428
|
+
imports.wbg.__wbg_location_new = function(arg0) {
|
|
1429
|
+
const ret = Location.__wrap(arg0);
|
|
1430
|
+
return addHeapObject(ret);
|
|
1431
|
+
};
|
|
1427
1432
|
imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
|
|
1428
1433
|
const ret = NextInputModel.__wrap(arg0);
|
|
1429
1434
|
return addHeapObject(ret);
|
package/mons-web_bg.wasm
CHANGED
|
Binary file
|