mons-rust 0.1.31 → 0.1.33
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 +45 -35
- package/mons-rust.js +34 -14
- package/mons-rust_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-rust.d.ts
CHANGED
|
@@ -10,19 +10,6 @@
|
|
|
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 NextInputKind {
|
|
14
|
-
MonMove = 0,
|
|
15
|
-
ManaMove = 1,
|
|
16
|
-
MysticAction = 2,
|
|
17
|
-
DemonAction = 3,
|
|
18
|
-
DemonAdditionalStep = 4,
|
|
19
|
-
SpiritTargetCapture = 5,
|
|
20
|
-
SpiritTargetMove = 6,
|
|
21
|
-
SelectConsumable = 7,
|
|
22
|
-
BombAttack = 8,
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
*/
|
|
26
13
|
export enum EventModelKind {
|
|
27
14
|
MonMove = 0,
|
|
28
15
|
ManaMove = 1,
|
|
@@ -54,9 +41,13 @@ export enum OutputModelKind {
|
|
|
54
41
|
}
|
|
55
42
|
/**
|
|
56
43
|
*/
|
|
57
|
-
export enum
|
|
44
|
+
export enum SquareModelKind {
|
|
58
45
|
Regular = 0,
|
|
59
|
-
|
|
46
|
+
ConsumableBase = 1,
|
|
47
|
+
SupermanaBase = 2,
|
|
48
|
+
ManaBase = 3,
|
|
49
|
+
ManaPool = 4,
|
|
50
|
+
MonBase = 5,
|
|
60
51
|
}
|
|
61
52
|
/**
|
|
62
53
|
*/
|
|
@@ -69,10 +60,15 @@ export enum ItemModelKind {
|
|
|
69
60
|
}
|
|
70
61
|
/**
|
|
71
62
|
*/
|
|
72
|
-
export enum
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
export enum ManaKind {
|
|
64
|
+
Regular = 0,
|
|
65
|
+
Supermana = 1,
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
*/
|
|
69
|
+
export enum Color {
|
|
70
|
+
White = 0,
|
|
71
|
+
Black = 1,
|
|
76
72
|
}
|
|
77
73
|
/**
|
|
78
74
|
*/
|
|
@@ -85,12 +81,6 @@ export enum MonKind {
|
|
|
85
81
|
}
|
|
86
82
|
/**
|
|
87
83
|
*/
|
|
88
|
-
export enum Color {
|
|
89
|
-
White = 0,
|
|
90
|
-
Black = 1,
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
*/
|
|
94
84
|
export enum Modifier {
|
|
95
85
|
SelectPotion = 0,
|
|
96
86
|
SelectBomb = 1,
|
|
@@ -98,21 +88,31 @@ export enum Modifier {
|
|
|
98
88
|
}
|
|
99
89
|
/**
|
|
100
90
|
*/
|
|
101
|
-
export enum
|
|
91
|
+
export enum NextInputKind {
|
|
102
92
|
MonMove = 0,
|
|
103
93
|
ManaMove = 1,
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
MysticAction = 2,
|
|
95
|
+
DemonAction = 3,
|
|
96
|
+
DemonAdditionalStep = 4,
|
|
97
|
+
SpiritTargetCapture = 5,
|
|
98
|
+
SpiritTargetMove = 6,
|
|
99
|
+
SelectConsumable = 7,
|
|
100
|
+
BombAttack = 8,
|
|
106
101
|
}
|
|
107
102
|
/**
|
|
108
103
|
*/
|
|
109
|
-
export enum
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
104
|
+
export enum Consumable {
|
|
105
|
+
Potion = 0,
|
|
106
|
+
Bomb = 1,
|
|
107
|
+
BombOrPotion = 2,
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
*/
|
|
111
|
+
export enum AvailableMoveKind {
|
|
112
|
+
MonMove = 0,
|
|
113
|
+
ManaMove = 1,
|
|
114
|
+
Action = 2,
|
|
115
|
+
Potion = 3,
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
*/
|
|
@@ -268,6 +268,16 @@ export class MonsGameModel {
|
|
|
268
268
|
*/
|
|
269
269
|
is_later_than(other_fen: string): boolean;
|
|
270
270
|
/**
|
|
271
|
+
* @returns {boolean}
|
|
272
|
+
*/
|
|
273
|
+
is_moves_verified(): boolean;
|
|
274
|
+
/**
|
|
275
|
+
* @param {string} flat_moves_string_w
|
|
276
|
+
* @param {string} flat_moves_string_b
|
|
277
|
+
* @returns {boolean}
|
|
278
|
+
*/
|
|
279
|
+
verify_moves(flat_moves_string_w: string, flat_moves_string_b: string): boolean;
|
|
280
|
+
/**
|
|
271
281
|
* @returns {Color}
|
|
272
282
|
*/
|
|
273
283
|
active_color(): Color;
|
package/mons-rust.js
CHANGED
|
@@ -192,9 +192,6 @@ module.exports.winner = function(fen_w, fen_b, flat_moves_string_w, flat_moves_s
|
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
-
/**
|
|
196
|
-
*/
|
|
197
|
-
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", });
|
|
198
195
|
/**
|
|
199
196
|
*/
|
|
200
197
|
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", });
|
|
@@ -203,28 +200,31 @@ module.exports.EventModelKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove
|
|
|
203
200
|
module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
204
201
|
/**
|
|
205
202
|
*/
|
|
206
|
-
module.exports.
|
|
203
|
+
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", });
|
|
207
204
|
/**
|
|
208
205
|
*/
|
|
209
206
|
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", });
|
|
210
207
|
/**
|
|
211
208
|
*/
|
|
212
|
-
module.exports.
|
|
209
|
+
module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
213
210
|
/**
|
|
214
211
|
*/
|
|
215
|
-
module.exports.
|
|
212
|
+
module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
216
213
|
/**
|
|
217
214
|
*/
|
|
218
|
-
module.exports.
|
|
215
|
+
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", });
|
|
219
216
|
/**
|
|
220
217
|
*/
|
|
221
218
|
module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
222
219
|
/**
|
|
223
220
|
*/
|
|
224
|
-
module.exports.
|
|
221
|
+
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", });
|
|
225
222
|
/**
|
|
226
223
|
*/
|
|
227
|
-
module.exports.
|
|
224
|
+
module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
225
|
+
/**
|
|
226
|
+
*/
|
|
227
|
+
module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
228
228
|
|
|
229
229
|
const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
230
230
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -812,6 +812,26 @@ class MonsGameModel {
|
|
|
812
812
|
return ret !== 0;
|
|
813
813
|
}
|
|
814
814
|
/**
|
|
815
|
+
* @returns {boolean}
|
|
816
|
+
*/
|
|
817
|
+
is_moves_verified() {
|
|
818
|
+
const ret = wasm.monsgamemodel_is_moves_verified(this.__wbg_ptr);
|
|
819
|
+
return ret !== 0;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* @param {string} flat_moves_string_w
|
|
823
|
+
* @param {string} flat_moves_string_b
|
|
824
|
+
* @returns {boolean}
|
|
825
|
+
*/
|
|
826
|
+
verify_moves(flat_moves_string_w, flat_moves_string_b) {
|
|
827
|
+
const ptr0 = passStringToWasm0(flat_moves_string_w, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
828
|
+
const len0 = WASM_VECTOR_LEN;
|
|
829
|
+
const ptr1 = passStringToWasm0(flat_moves_string_b, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
830
|
+
const len1 = WASM_VECTOR_LEN;
|
|
831
|
+
const ret = wasm.monsgamemodel_verify_moves(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
832
|
+
return ret !== 0;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
815
835
|
* @returns {Color}
|
|
816
836
|
*/
|
|
817
837
|
active_color() {
|
|
@@ -1142,6 +1162,11 @@ class SquareModel {
|
|
|
1142
1162
|
}
|
|
1143
1163
|
module.exports.SquareModel = SquareModel;
|
|
1144
1164
|
|
|
1165
|
+
module.exports.__wbg_location_new = function(arg0) {
|
|
1166
|
+
const ret = Location.__wrap(arg0);
|
|
1167
|
+
return addHeapObject(ret);
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1145
1170
|
module.exports.__wbg_nextinputmodel_new = function(arg0) {
|
|
1146
1171
|
const ret = NextInputModel.__wrap(arg0);
|
|
1147
1172
|
return addHeapObject(ret);
|
|
@@ -1152,11 +1177,6 @@ module.exports.__wbg_eventmodel_new = function(arg0) {
|
|
|
1152
1177
|
return addHeapObject(ret);
|
|
1153
1178
|
};
|
|
1154
1179
|
|
|
1155
|
-
module.exports.__wbg_location_new = function(arg0) {
|
|
1156
|
-
const ret = Location.__wrap(arg0);
|
|
1157
|
-
return addHeapObject(ret);
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
1180
|
module.exports.__wbg_location_unwrap = function(arg0) {
|
|
1161
1181
|
const ret = Location.__unwrap(takeObject(arg0));
|
|
1162
1182
|
return ret;
|
package/mons-rust_bg.wasm
CHANGED
|
Binary file
|