mons-rust 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-rust.d.ts +64 -56
- package/mons-rust.js +19 -14
- package/mons-rust_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-rust.d.ts
CHANGED
|
@@ -10,10 +10,57 @@
|
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
export enum OutputModelKind {
|
|
24
|
+
InvalidInput = 0,
|
|
25
|
+
LocationsToStartFrom = 1,
|
|
26
|
+
NextInputOptions = 2,
|
|
27
|
+
Events = 3,
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
*/
|
|
31
|
+
export enum GameVariant {
|
|
32
|
+
Classic = 0,
|
|
33
|
+
SwappedManaRows = 1,
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*/
|
|
37
|
+
export enum ManaKind {
|
|
38
|
+
Regular = 0,
|
|
39
|
+
Supermana = 1,
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
*/
|
|
43
|
+
export enum Color {
|
|
44
|
+
White = 0,
|
|
45
|
+
Black = 1,
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
*/
|
|
49
|
+
export enum MonKind {
|
|
50
|
+
Demon = 0,
|
|
51
|
+
Drainer = 1,
|
|
52
|
+
Angel = 2,
|
|
53
|
+
Spirit = 3,
|
|
54
|
+
Mystic = 4,
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
*/
|
|
58
|
+
export enum ItemModelKind {
|
|
59
|
+
Mon = 0,
|
|
60
|
+
Mana = 1,
|
|
61
|
+
MonWithMana = 2,
|
|
62
|
+
MonWithConsumable = 3,
|
|
63
|
+
Consumable = 4,
|
|
17
64
|
}
|
|
18
65
|
/**
|
|
19
66
|
*/
|
|
@@ -41,36 +88,11 @@ export enum EventModelKind {
|
|
|
41
88
|
}
|
|
42
89
|
/**
|
|
43
90
|
*/
|
|
44
|
-
export enum
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Consumable = 4,
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
*/
|
|
53
|
-
export enum OutputModelKind {
|
|
54
|
-
InvalidInput = 0,
|
|
55
|
-
LocationsToStartFrom = 1,
|
|
56
|
-
NextInputOptions = 2,
|
|
57
|
-
Events = 3,
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
*/
|
|
61
|
-
export enum SquareModelKind {
|
|
62
|
-
Regular = 0,
|
|
63
|
-
ConsumableBase = 1,
|
|
64
|
-
SupermanaBase = 2,
|
|
65
|
-
ManaBase = 3,
|
|
66
|
-
ManaPool = 4,
|
|
67
|
-
MonBase = 5,
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
*/
|
|
71
|
-
export enum ManaKind {
|
|
72
|
-
Regular = 0,
|
|
73
|
-
Supermana = 1,
|
|
91
|
+
export enum AvailableMoveKind {
|
|
92
|
+
MonMove = 0,
|
|
93
|
+
ManaMove = 1,
|
|
94
|
+
Action = 2,
|
|
95
|
+
Potion = 3,
|
|
74
96
|
}
|
|
75
97
|
/**
|
|
76
98
|
*/
|
|
@@ -81,17 +103,10 @@ export enum Consumable {
|
|
|
81
103
|
}
|
|
82
104
|
/**
|
|
83
105
|
*/
|
|
84
|
-
export enum
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Potion = 3,
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
*/
|
|
92
|
-
export enum Color {
|
|
93
|
-
White = 0,
|
|
94
|
-
Black = 1,
|
|
106
|
+
export enum Modifier {
|
|
107
|
+
SelectPotion = 0,
|
|
108
|
+
SelectBomb = 1,
|
|
109
|
+
Cancel = 2,
|
|
95
110
|
}
|
|
96
111
|
/**
|
|
97
112
|
*/
|
|
@@ -108,15 +123,6 @@ export enum NextInputKind {
|
|
|
108
123
|
}
|
|
109
124
|
/**
|
|
110
125
|
*/
|
|
111
|
-
export enum MonKind {
|
|
112
|
-
Demon = 0,
|
|
113
|
-
Drainer = 1,
|
|
114
|
-
Angel = 2,
|
|
115
|
-
Spirit = 3,
|
|
116
|
-
Mystic = 4,
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
*/
|
|
120
126
|
export class EventModel {
|
|
121
127
|
free(): void;
|
|
122
128
|
/**
|
|
@@ -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}
|
package/mons-rust.js
CHANGED
|
@@ -201,37 +201,40 @@ function handleError(f, args) {
|
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
*/
|
|
204
|
-
module.exports.
|
|
204
|
+
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", });
|
|
205
205
|
/**
|
|
206
206
|
*/
|
|
207
|
-
module.exports.
|
|
207
|
+
module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
208
208
|
/**
|
|
209
209
|
*/
|
|
210
|
-
module.exports.
|
|
210
|
+
module.exports.GameVariant = Object.freeze({ Classic:0,"0":"Classic",SwappedManaRows:1,"1":"SwappedManaRows", });
|
|
211
211
|
/**
|
|
212
212
|
*/
|
|
213
|
-
module.exports.
|
|
213
|
+
module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
214
214
|
/**
|
|
215
215
|
*/
|
|
216
|
-
module.exports.
|
|
216
|
+
module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
217
217
|
/**
|
|
218
218
|
*/
|
|
219
|
-
module.exports.
|
|
219
|
+
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", });
|
|
220
220
|
/**
|
|
221
221
|
*/
|
|
222
|
-
module.exports.
|
|
222
|
+
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", });
|
|
223
|
+
/**
|
|
224
|
+
*/
|
|
225
|
+
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", });
|
|
223
226
|
/**
|
|
224
227
|
*/
|
|
225
228
|
module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
226
229
|
/**
|
|
227
230
|
*/
|
|
228
|
-
module.exports.
|
|
231
|
+
module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
229
232
|
/**
|
|
230
233
|
*/
|
|
231
|
-
module.exports.
|
|
234
|
+
module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
232
235
|
/**
|
|
233
236
|
*/
|
|
234
|
-
module.exports.
|
|
237
|
+
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", });
|
|
235
238
|
|
|
236
239
|
const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
237
240
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -871,10 +874,11 @@ class MonsGameModel {
|
|
|
871
874
|
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
872
875
|
}
|
|
873
876
|
/**
|
|
877
|
+
* @param {GameVariant} variant
|
|
874
878
|
* @returns {MonsGameModel}
|
|
875
879
|
*/
|
|
876
|
-
static newForSimulation() {
|
|
877
|
-
const ret = wasm.monsgamemodel_newForSimulation();
|
|
880
|
+
static newForSimulation(variant) {
|
|
881
|
+
const ret = wasm.monsgamemodel_newForSimulation(variant);
|
|
878
882
|
return MonsGameModel.__wrap(ret);
|
|
879
883
|
}
|
|
880
884
|
/**
|
|
@@ -977,10 +981,11 @@ class MonsGameModel {
|
|
|
977
981
|
}
|
|
978
982
|
}
|
|
979
983
|
/**
|
|
984
|
+
* @param {GameVariant} variant
|
|
980
985
|
* @returns {MonsGameModel}
|
|
981
986
|
*/
|
|
982
|
-
static new() {
|
|
983
|
-
const ret = wasm.monsgamemodel_new();
|
|
987
|
+
static new(variant) {
|
|
988
|
+
const ret = wasm.monsgamemodel_new(variant);
|
|
984
989
|
return MonsGameModel.__wrap(ret);
|
|
985
990
|
}
|
|
986
991
|
/**
|
package/mons-rust_bg.wasm
CHANGED
|
Binary file
|