mons-web 0.1.127 → 0.1.128
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 +70 -62
- package/mons-web.js +20 -15
- package/mons-web_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-web.d.ts
CHANGED
|
@@ -10,32 +10,33 @@
|
|
|
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 SquareModelKind {
|
|
14
|
-
Regular = 0,
|
|
15
|
-
ConsumableBase = 1,
|
|
16
|
-
SupermanaBase = 2,
|
|
17
|
-
ManaBase = 3,
|
|
18
|
-
ManaPool = 4,
|
|
19
|
-
MonBase = 5,
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
*/
|
|
23
13
|
export enum ManaKind {
|
|
24
14
|
Regular = 0,
|
|
25
15
|
Supermana = 1,
|
|
26
16
|
}
|
|
27
17
|
/**
|
|
28
18
|
*/
|
|
29
|
-
export enum
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
export enum EventModelKind {
|
|
20
|
+
MonMove = 0,
|
|
21
|
+
ManaMove = 1,
|
|
22
|
+
ManaScored = 2,
|
|
23
|
+
MysticAction = 3,
|
|
24
|
+
DemonAction = 4,
|
|
25
|
+
DemonAdditionalStep = 5,
|
|
26
|
+
SpiritTargetMove = 6,
|
|
27
|
+
PickupBomb = 7,
|
|
28
|
+
PickupPotion = 8,
|
|
29
|
+
PickupMana = 9,
|
|
30
|
+
MonFainted = 10,
|
|
31
|
+
ManaDropped = 11,
|
|
32
|
+
SupermanaBackToBase = 12,
|
|
33
|
+
BombAttack = 13,
|
|
34
|
+
MonAwake = 14,
|
|
35
|
+
BombExplosion = 15,
|
|
36
|
+
NextTurn = 16,
|
|
37
|
+
GameOver = 17,
|
|
38
|
+
Takeback = 18,
|
|
39
|
+
UsePotion = 19,
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
*/
|
|
@@ -55,48 +56,30 @@ export enum ItemModelKind {
|
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
58
|
*/
|
|
58
|
-
export enum
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
NextInputOptions = 2,
|
|
62
|
-
Events = 3,
|
|
59
|
+
export enum GameVariant {
|
|
60
|
+
Classic = 0,
|
|
61
|
+
SwappedManaRows = 1,
|
|
63
62
|
}
|
|
64
63
|
/**
|
|
65
64
|
*/
|
|
66
|
-
export enum
|
|
65
|
+
export enum AvailableMoveKind {
|
|
67
66
|
MonMove = 0,
|
|
68
67
|
ManaMove = 1,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
DemonAction = 4,
|
|
72
|
-
DemonAdditionalStep = 5,
|
|
73
|
-
SpiritTargetMove = 6,
|
|
74
|
-
PickupBomb = 7,
|
|
75
|
-
PickupPotion = 8,
|
|
76
|
-
PickupMana = 9,
|
|
77
|
-
MonFainted = 10,
|
|
78
|
-
ManaDropped = 11,
|
|
79
|
-
SupermanaBackToBase = 12,
|
|
80
|
-
BombAttack = 13,
|
|
81
|
-
MonAwake = 14,
|
|
82
|
-
BombExplosion = 15,
|
|
83
|
-
NextTurn = 16,
|
|
84
|
-
GameOver = 17,
|
|
85
|
-
Takeback = 18,
|
|
86
|
-
UsePotion = 19,
|
|
68
|
+
Action = 2,
|
|
69
|
+
Potion = 3,
|
|
87
70
|
}
|
|
88
71
|
/**
|
|
89
72
|
*/
|
|
90
|
-
export enum
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
73
|
+
export enum Color {
|
|
74
|
+
White = 0,
|
|
75
|
+
Black = 1,
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
*/
|
|
79
|
+
export enum Modifier {
|
|
80
|
+
SelectPotion = 0,
|
|
81
|
+
SelectBomb = 1,
|
|
82
|
+
Cancel = 2,
|
|
100
83
|
}
|
|
101
84
|
/**
|
|
102
85
|
*/
|
|
@@ -109,11 +92,34 @@ export enum MonKind {
|
|
|
109
92
|
}
|
|
110
93
|
/**
|
|
111
94
|
*/
|
|
112
|
-
export enum
|
|
95
|
+
export enum SquareModelKind {
|
|
96
|
+
Regular = 0,
|
|
97
|
+
ConsumableBase = 1,
|
|
98
|
+
SupermanaBase = 2,
|
|
99
|
+
ManaBase = 3,
|
|
100
|
+
ManaPool = 4,
|
|
101
|
+
MonBase = 5,
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
*/
|
|
105
|
+
export enum NextInputKind {
|
|
113
106
|
MonMove = 0,
|
|
114
107
|
ManaMove = 1,
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
MysticAction = 2,
|
|
109
|
+
DemonAction = 3,
|
|
110
|
+
DemonAdditionalStep = 4,
|
|
111
|
+
SpiritTargetCapture = 5,
|
|
112
|
+
SpiritTargetMove = 6,
|
|
113
|
+
SelectConsumable = 7,
|
|
114
|
+
BombAttack = 8,
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
*/
|
|
118
|
+
export enum OutputModelKind {
|
|
119
|
+
InvalidInput = 0,
|
|
120
|
+
LocationsToStartFrom = 1,
|
|
121
|
+
NextInputOptions = 2,
|
|
122
|
+
Events = 3,
|
|
117
123
|
}
|
|
118
124
|
/**
|
|
119
125
|
*/
|
|
@@ -293,9 +299,10 @@ export class MonsGameModel {
|
|
|
293
299
|
*/
|
|
294
300
|
without_last_turn(takeback_fens: (string)[]): MonsGameModel | undefined;
|
|
295
301
|
/**
|
|
302
|
+
* @param {GameVariant} variant
|
|
296
303
|
* @returns {MonsGameModel}
|
|
297
304
|
*/
|
|
298
|
-
static newForSimulation(): MonsGameModel;
|
|
305
|
+
static newForSimulation(variant: GameVariant): MonsGameModel;
|
|
299
306
|
/**
|
|
300
307
|
* @returns {Int32Array}
|
|
301
308
|
*/
|
|
@@ -326,9 +333,10 @@ export class MonsGameModel {
|
|
|
326
333
|
*/
|
|
327
334
|
fen(): string;
|
|
328
335
|
/**
|
|
336
|
+
* @param {GameVariant} variant
|
|
329
337
|
* @returns {MonsGameModel}
|
|
330
338
|
*/
|
|
331
|
-
static new(): MonsGameModel;
|
|
339
|
+
static new(variant: GameVariant): MonsGameModel;
|
|
332
340
|
/**
|
|
333
341
|
* @param {Location} at
|
|
334
342
|
* @returns {ItemModel | undefined}
|
|
@@ -495,8 +503,8 @@ export interface InitOutput {
|
|
|
495
503
|
readonly monsgamemodel_is_moves_verified: (a: number) => number;
|
|
496
504
|
readonly monsgamemodel_item: (a: number, b: number) => number;
|
|
497
505
|
readonly monsgamemodel_locations_with_content: (a: number, b: number) => void;
|
|
498
|
-
readonly monsgamemodel_new: () => number;
|
|
499
|
-
readonly monsgamemodel_newForSimulation: () => number;
|
|
506
|
+
readonly monsgamemodel_new: (a: number) => number;
|
|
507
|
+
readonly monsgamemodel_newForSimulation: (a: number) => number;
|
|
500
508
|
readonly monsgamemodel_process_input: (a: number, b: number, c: number, d: number) => number;
|
|
501
509
|
readonly monsgamemodel_process_input_fen: (a: number, b: number, c: number) => number;
|
|
502
510
|
readonly monsgamemodel_remove_item: (a: number, b: number) => void;
|
|
@@ -522,6 +530,7 @@ export interface InitOutput {
|
|
|
522
530
|
readonly __wbg_set_nextinputmodel_location: (a: number, b: number) => void;
|
|
523
531
|
readonly __wbg_get_nextinputmodel_location: (a: number) => number;
|
|
524
532
|
readonly __wbg_squaremodel_free: (a: number) => void;
|
|
533
|
+
readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
525
534
|
readonly __wbg_get_location_i: (a: number) => number;
|
|
526
535
|
readonly __wbg_get_location_j: (a: number) => number;
|
|
527
536
|
readonly __wbg_get_mon_color: (a: number) => number;
|
|
@@ -539,7 +548,6 @@ export interface InitOutput {
|
|
|
539
548
|
readonly location_new: (a: number, b: number) => number;
|
|
540
549
|
readonly __wbg_set_mon_cooldown: (a: number, b: number) => void;
|
|
541
550
|
readonly __wbg_get_mon_cooldown: (a: 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
551
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
544
552
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
545
553
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
package/mons-web.js
CHANGED
|
@@ -198,16 +198,10 @@ 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
|
|
208
|
-
/**
|
|
209
|
-
*/
|
|
210
|
-
export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
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", });
|
|
211
205
|
/**
|
|
212
206
|
*/
|
|
213
207
|
export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
@@ -216,19 +210,28 @@ export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb
|
|
|
216
210
|
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", });
|
|
217
211
|
/**
|
|
218
212
|
*/
|
|
219
|
-
export const
|
|
213
|
+
export const GameVariant = Object.freeze({ Classic:0,"0":"Classic",SwappedManaRows:1,"1":"SwappedManaRows", });
|
|
220
214
|
/**
|
|
221
215
|
*/
|
|
222
|
-
export const
|
|
216
|
+
export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
223
217
|
/**
|
|
224
218
|
*/
|
|
225
|
-
export const
|
|
219
|
+
export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
220
|
+
/**
|
|
221
|
+
*/
|
|
222
|
+
export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
226
223
|
/**
|
|
227
224
|
*/
|
|
228
225
|
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", });
|
|
229
226
|
/**
|
|
230
227
|
*/
|
|
231
|
-
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
|
+
/**
|
|
230
|
+
*/
|
|
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
|
+
/**
|
|
233
|
+
*/
|
|
234
|
+
export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
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
|
/**
|
package/mons-web_bg.wasm
CHANGED
|
Binary file
|