mons-rust 0.1.61 → 0.1.65
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 +138 -133
- package/mons-rust.js +304 -285
- package/mons-rust_bg.wasm +0 -0
- package/package.json +1 -1
package/mons-rust.d.ts
CHANGED
|
@@ -10,6 +10,45 @@
|
|
|
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 EventModelKind {
|
|
14
|
+
MonMove = 0,
|
|
15
|
+
ManaMove = 1,
|
|
16
|
+
ManaScored = 2,
|
|
17
|
+
MysticAction = 3,
|
|
18
|
+
DemonAction = 4,
|
|
19
|
+
DemonAdditionalStep = 5,
|
|
20
|
+
SpiritTargetMove = 6,
|
|
21
|
+
PickupBomb = 7,
|
|
22
|
+
PickupPotion = 8,
|
|
23
|
+
PickupMana = 9,
|
|
24
|
+
MonFainted = 10,
|
|
25
|
+
ManaDropped = 11,
|
|
26
|
+
SupermanaBackToBase = 12,
|
|
27
|
+
BombAttack = 13,
|
|
28
|
+
MonAwake = 14,
|
|
29
|
+
BombExplosion = 15,
|
|
30
|
+
NextTurn = 16,
|
|
31
|
+
GameOver = 17,
|
|
32
|
+
Takeback = 18,
|
|
33
|
+
UsePotion = 19,
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*/
|
|
37
|
+
export enum OutputModelKind {
|
|
38
|
+
InvalidInput = 0,
|
|
39
|
+
LocationsToStartFrom = 1,
|
|
40
|
+
NextInputOptions = 2,
|
|
41
|
+
Events = 3,
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*/
|
|
45
|
+
export enum Consumable {
|
|
46
|
+
Potion = 0,
|
|
47
|
+
Bomb = 1,
|
|
48
|
+
BombOrPotion = 2,
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
*/
|
|
13
52
|
export enum ItemModelKind {
|
|
14
53
|
Mon = 0,
|
|
15
54
|
Mana = 1,
|
|
@@ -19,12 +58,11 @@ export enum ItemModelKind {
|
|
|
19
58
|
}
|
|
20
59
|
/**
|
|
21
60
|
*/
|
|
22
|
-
export enum
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Mystic = 4,
|
|
61
|
+
export enum AvailableMoveKind {
|
|
62
|
+
MonMove = 0,
|
|
63
|
+
ManaMove = 1,
|
|
64
|
+
Action = 2,
|
|
65
|
+
Potion = 3,
|
|
28
66
|
}
|
|
29
67
|
/**
|
|
30
68
|
*/
|
|
@@ -41,18 +79,9 @@ export enum NextInputKind {
|
|
|
41
79
|
}
|
|
42
80
|
/**
|
|
43
81
|
*/
|
|
44
|
-
export enum
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Action = 2,
|
|
48
|
-
Potion = 3,
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
*/
|
|
52
|
-
export enum Consumable {
|
|
53
|
-
Potion = 0,
|
|
54
|
-
Bomb = 1,
|
|
55
|
-
BombOrPotion = 2,
|
|
82
|
+
export enum Color {
|
|
83
|
+
White = 0,
|
|
84
|
+
Black = 1,
|
|
56
85
|
}
|
|
57
86
|
/**
|
|
58
87
|
*/
|
|
@@ -66,54 +95,25 @@ export enum SquareModelKind {
|
|
|
66
95
|
}
|
|
67
96
|
/**
|
|
68
97
|
*/
|
|
69
|
-
export enum Modifier {
|
|
70
|
-
SelectPotion = 0,
|
|
71
|
-
SelectBomb = 1,
|
|
72
|
-
Cancel = 2,
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
*/
|
|
76
|
-
export enum EventModelKind {
|
|
77
|
-
MonMove = 0,
|
|
78
|
-
ManaMove = 1,
|
|
79
|
-
ManaScored = 2,
|
|
80
|
-
MysticAction = 3,
|
|
81
|
-
DemonAction = 4,
|
|
82
|
-
DemonAdditionalStep = 5,
|
|
83
|
-
SpiritTargetMove = 6,
|
|
84
|
-
PickupBomb = 7,
|
|
85
|
-
PickupPotion = 8,
|
|
86
|
-
PickupMana = 9,
|
|
87
|
-
MonFainted = 10,
|
|
88
|
-
ManaDropped = 11,
|
|
89
|
-
SupermanaBackToBase = 12,
|
|
90
|
-
BombAttack = 13,
|
|
91
|
-
MonAwake = 14,
|
|
92
|
-
BombExplosion = 15,
|
|
93
|
-
NextTurn = 16,
|
|
94
|
-
GameOver = 17,
|
|
95
|
-
Takeback = 18,
|
|
96
|
-
UsePotion = 19,
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
*/
|
|
100
98
|
export enum ManaKind {
|
|
101
99
|
Regular = 0,
|
|
102
100
|
Supermana = 1,
|
|
103
101
|
}
|
|
104
102
|
/**
|
|
105
103
|
*/
|
|
106
|
-
export enum
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Events = 3,
|
|
104
|
+
export enum Modifier {
|
|
105
|
+
SelectPotion = 0,
|
|
106
|
+
SelectBomb = 1,
|
|
107
|
+
Cancel = 2,
|
|
111
108
|
}
|
|
112
109
|
/**
|
|
113
110
|
*/
|
|
114
|
-
export enum
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
export enum MonKind {
|
|
112
|
+
Demon = 0,
|
|
113
|
+
Drainer = 1,
|
|
114
|
+
Angel = 2,
|
|
115
|
+
Spirit = 3,
|
|
116
|
+
Mystic = 4,
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
*/
|
|
@@ -190,6 +190,13 @@ export class ManaModel {
|
|
|
190
190
|
export class Mon {
|
|
191
191
|
free(): void;
|
|
192
192
|
/**
|
|
193
|
+
* @returns {boolean}
|
|
194
|
+
*/
|
|
195
|
+
is_fainted(): boolean;
|
|
196
|
+
/**
|
|
197
|
+
*/
|
|
198
|
+
decrease_cooldown(): void;
|
|
199
|
+
/**
|
|
193
200
|
* @param {MonKind} kind
|
|
194
201
|
* @param {Color} color
|
|
195
202
|
* @param {number} cooldown
|
|
@@ -197,16 +204,9 @@ export class Mon {
|
|
|
197
204
|
*/
|
|
198
205
|
static new(kind: MonKind, color: Color, cooldown: number): Mon;
|
|
199
206
|
/**
|
|
200
|
-
* @returns {boolean}
|
|
201
|
-
*/
|
|
202
|
-
is_fainted(): boolean;
|
|
203
|
-
/**
|
|
204
207
|
*/
|
|
205
208
|
faint(): void;
|
|
206
209
|
/**
|
|
207
|
-
*/
|
|
208
|
-
decrease_cooldown(): void;
|
|
209
|
-
/**
|
|
210
210
|
*/
|
|
211
211
|
color: Color;
|
|
212
212
|
/**
|
|
@@ -221,119 +221,120 @@ export class Mon {
|
|
|
221
221
|
export class MonsGameModel {
|
|
222
222
|
free(): void;
|
|
223
223
|
/**
|
|
224
|
-
* @returns {
|
|
225
|
-
*/
|
|
226
|
-
static new(): MonsGameModel;
|
|
227
|
-
/**
|
|
228
|
-
* @param {string} fen
|
|
229
|
-
* @returns {MonsGameModel | undefined}
|
|
230
|
-
*/
|
|
231
|
-
static from_fen(fen: string): MonsGameModel | undefined;
|
|
232
|
-
/**
|
|
233
|
-
* @returns {MonsGameModel | undefined}
|
|
224
|
+
* @returns {number}
|
|
234
225
|
*/
|
|
235
|
-
|
|
226
|
+
black_score(): number;
|
|
236
227
|
/**
|
|
237
|
-
* @
|
|
228
|
+
* @param {Location} location
|
|
238
229
|
*/
|
|
239
|
-
|
|
230
|
+
remove_item(location: Location): void;
|
|
240
231
|
/**
|
|
241
|
-
* @returns {
|
|
232
|
+
* @returns {number}
|
|
242
233
|
*/
|
|
243
|
-
|
|
234
|
+
turn_number(): number;
|
|
244
235
|
/**
|
|
245
|
-
* @returns {
|
|
236
|
+
* @returns {number}
|
|
246
237
|
*/
|
|
247
|
-
|
|
238
|
+
white_score(): number;
|
|
248
239
|
/**
|
|
249
|
-
* @
|
|
250
|
-
* @param {Modifier | undefined} [modifier]
|
|
251
|
-
* @returns {OutputModel}
|
|
240
|
+
* @returns {Color}
|
|
252
241
|
*/
|
|
253
|
-
|
|
242
|
+
active_color(): Color;
|
|
254
243
|
/**
|
|
255
244
|
* @param {Color} color
|
|
256
245
|
* @returns {boolean}
|
|
257
246
|
*/
|
|
258
247
|
can_takeback(color: Color): boolean;
|
|
259
248
|
/**
|
|
260
|
-
* @
|
|
249
|
+
* @param {string} flat_moves_string_w
|
|
250
|
+
* @param {string} flat_moves_string_b
|
|
251
|
+
* @returns {boolean}
|
|
261
252
|
*/
|
|
262
|
-
|
|
253
|
+
verify_moves(flat_moves_string_w: string, flat_moves_string_b: string): boolean;
|
|
263
254
|
/**
|
|
264
|
-
* @
|
|
265
|
-
* @returns {OutputModel}
|
|
255
|
+
* @returns {Color | undefined}
|
|
266
256
|
*/
|
|
267
|
-
|
|
257
|
+
winner_color(): Color | undefined;
|
|
268
258
|
/**
|
|
269
|
-
* @param {
|
|
259
|
+
* @param {string} other_fen
|
|
260
|
+
* @returns {boolean}
|
|
270
261
|
*/
|
|
271
|
-
|
|
262
|
+
is_later_than(other_fen: string): boolean;
|
|
272
263
|
/**
|
|
273
|
-
* @param {Location}
|
|
274
|
-
* @
|
|
264
|
+
* @param {(Location)[]} locations
|
|
265
|
+
* @param {Modifier | undefined} [modifier]
|
|
266
|
+
* @returns {OutputModel}
|
|
275
267
|
*/
|
|
276
|
-
|
|
268
|
+
process_input(locations: (Location)[], modifier?: Modifier): OutputModel;
|
|
277
269
|
/**
|
|
278
|
-
* @
|
|
279
|
-
* @returns {SquareModel}
|
|
270
|
+
* @returns {(string)[]}
|
|
280
271
|
*/
|
|
281
|
-
|
|
272
|
+
takeback_fens(): (string)[];
|
|
282
273
|
/**
|
|
283
|
-
* @
|
|
284
|
-
* @returns {boolean}
|
|
274
|
+
* @returns {OutputModel}
|
|
285
275
|
*/
|
|
286
|
-
|
|
276
|
+
smart_automove(): OutputModel;
|
|
287
277
|
/**
|
|
288
278
|
* @returns {boolean}
|
|
289
279
|
*/
|
|
290
280
|
is_moves_verified(): boolean;
|
|
291
281
|
/**
|
|
292
|
-
* @param {string}
|
|
293
|
-
* @
|
|
294
|
-
* @returns {boolean}
|
|
295
|
-
*/
|
|
296
|
-
verify_moves(flat_moves_string_w: string, flat_moves_string_b: string): boolean;
|
|
297
|
-
/**
|
|
298
|
-
* @returns {Color}
|
|
282
|
+
* @param {string} input_fen
|
|
283
|
+
* @returns {OutputModel}
|
|
299
284
|
*/
|
|
300
|
-
|
|
285
|
+
process_input_fen(input_fen: string): OutputModel;
|
|
301
286
|
/**
|
|
302
|
-
* @
|
|
287
|
+
* @param {(string)[]} takeback_fens
|
|
288
|
+
* @returns {MonsGameModel | undefined}
|
|
303
289
|
*/
|
|
304
|
-
|
|
290
|
+
without_last_turn(takeback_fens: (string)[]): MonsGameModel | undefined;
|
|
305
291
|
/**
|
|
306
|
-
* @returns {
|
|
292
|
+
* @returns {Int32Array}
|
|
307
293
|
*/
|
|
308
|
-
|
|
294
|
+
available_move_kinds(): Int32Array;
|
|
309
295
|
/**
|
|
310
|
-
* @returns {
|
|
296
|
+
* @returns {(Location)[]}
|
|
311
297
|
*/
|
|
312
|
-
|
|
298
|
+
locations_with_content(): (Location)[];
|
|
313
299
|
/**
|
|
314
|
-
* @returns {
|
|
300
|
+
* @returns {(VerboseTrackingEntityModel)[]}
|
|
315
301
|
*/
|
|
316
|
-
|
|
302
|
+
verbose_tracking_entities(): (VerboseTrackingEntityModel)[];
|
|
317
303
|
/**
|
|
318
304
|
* @returns {Int32Array}
|
|
319
305
|
*/
|
|
320
306
|
inactive_player_items_counters(): Int32Array;
|
|
321
307
|
/**
|
|
322
|
-
* @returns {
|
|
308
|
+
* @returns {string}
|
|
323
309
|
*/
|
|
324
|
-
|
|
310
|
+
fen(): string;
|
|
325
311
|
/**
|
|
326
|
-
* @returns {
|
|
312
|
+
* @returns {MonsGameModel}
|
|
327
313
|
*/
|
|
328
|
-
|
|
314
|
+
static new(): MonsGameModel;
|
|
329
315
|
/**
|
|
330
|
-
* @
|
|
316
|
+
* @param {Location} at
|
|
317
|
+
* @returns {ItemModel | undefined}
|
|
331
318
|
*/
|
|
332
|
-
|
|
319
|
+
item(at: Location): ItemModel | undefined;
|
|
333
320
|
/**
|
|
334
|
-
* @
|
|
321
|
+
* @param {Location} at
|
|
322
|
+
* @returns {SquareModel}
|
|
335
323
|
*/
|
|
336
|
-
|
|
324
|
+
square(at: Location): SquareModel;
|
|
325
|
+
/**
|
|
326
|
+
* @returns {OutputModel}
|
|
327
|
+
*/
|
|
328
|
+
automove(): OutputModel;
|
|
329
|
+
/**
|
|
330
|
+
* @param {string} fen
|
|
331
|
+
* @returns {MonsGameModel | undefined}
|
|
332
|
+
*/
|
|
333
|
+
static from_fen(fen: string): MonsGameModel | undefined;
|
|
334
|
+
/**
|
|
335
|
+
* @returns {OutputModel}
|
|
336
|
+
*/
|
|
337
|
+
takeback(): OutputModel;
|
|
337
338
|
}
|
|
338
339
|
/**
|
|
339
340
|
*/
|
|
@@ -357,10 +358,6 @@ export class NextInputModel {
|
|
|
357
358
|
export class OutputModel {
|
|
358
359
|
free(): void;
|
|
359
360
|
/**
|
|
360
|
-
* @returns {(Location)[]}
|
|
361
|
-
*/
|
|
362
|
-
locations(): (Location)[];
|
|
363
|
-
/**
|
|
364
361
|
* @returns {(NextInputModel)[]}
|
|
365
362
|
*/
|
|
366
363
|
next_inputs(): (NextInputModel)[];
|
|
@@ -373,6 +370,10 @@ export class OutputModel {
|
|
|
373
370
|
*/
|
|
374
371
|
input_fen(): string;
|
|
375
372
|
/**
|
|
373
|
+
* @returns {(Location)[]}
|
|
374
|
+
*/
|
|
375
|
+
locations(): (Location)[];
|
|
376
|
+
/**
|
|
376
377
|
*/
|
|
377
378
|
kind: OutputModelKind;
|
|
378
379
|
}
|
|
@@ -396,14 +397,18 @@ export class VerboseTrackingEntityModel {
|
|
|
396
397
|
free(): void;
|
|
397
398
|
/**
|
|
398
399
|
* @returns {string}
|
|
400
|
+
*/
|
|
401
|
+
events_fen(): string;
|
|
402
|
+
/**
|
|
403
|
+
* @returns {string}
|
|
399
404
|
*/
|
|
400
405
|
fen(): string;
|
|
401
406
|
/**
|
|
402
|
-
* @returns {
|
|
407
|
+
* @returns {Color}
|
|
403
408
|
*/
|
|
404
|
-
|
|
409
|
+
color(): Color;
|
|
405
410
|
/**
|
|
406
|
-
* @returns {
|
|
411
|
+
* @returns {(EventModel)[]}
|
|
407
412
|
*/
|
|
408
|
-
|
|
413
|
+
events(): (EventModel)[];
|
|
409
414
|
}
|
package/mons-rust.js
CHANGED
|
@@ -106,6 +106,10 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
106
106
|
return ptr;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
function isLikeNone(x) {
|
|
110
|
+
return x === undefined || x === null;
|
|
111
|
+
}
|
|
112
|
+
|
|
109
113
|
let cachedInt32Memory0 = null;
|
|
110
114
|
|
|
111
115
|
function getInt32Memory0() {
|
|
@@ -124,18 +128,15 @@ function getUint32Memory0() {
|
|
|
124
128
|
return cachedUint32Memory0;
|
|
125
129
|
}
|
|
126
130
|
|
|
127
|
-
function
|
|
128
|
-
|
|
131
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
132
|
+
ptr = ptr >>> 0;
|
|
129
133
|
const mem = getUint32Memory0();
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
135
|
+
const result = [];
|
|
136
|
+
for (let i = 0; i < slice.length; i++) {
|
|
137
|
+
result.push(takeObject(slice[i]));
|
|
132
138
|
}
|
|
133
|
-
|
|
134
|
-
return ptr;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function isLikeNone(x) {
|
|
138
|
-
return x === undefined || x === null;
|
|
139
|
+
return result;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
function _assertClass(instance, klass) {
|
|
@@ -145,20 +146,19 @@ function _assertClass(instance, klass) {
|
|
|
145
146
|
return instance.ptr;
|
|
146
147
|
}
|
|
147
148
|
|
|
148
|
-
function
|
|
149
|
-
ptr =
|
|
150
|
-
|
|
149
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
150
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
151
|
+
const mem = getUint32Memory0();
|
|
152
|
+
for (let i = 0; i < array.length; i++) {
|
|
153
|
+
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
154
|
+
}
|
|
155
|
+
WASM_VECTOR_LEN = array.length;
|
|
156
|
+
return ptr;
|
|
151
157
|
}
|
|
152
158
|
|
|
153
|
-
function
|
|
159
|
+
function getArrayI32FromWasm0(ptr, len) {
|
|
154
160
|
ptr = ptr >>> 0;
|
|
155
|
-
|
|
156
|
-
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
157
|
-
const result = [];
|
|
158
|
-
for (let i = 0; i < slice.length; i++) {
|
|
159
|
-
result.push(takeObject(slice[i]));
|
|
160
|
-
}
|
|
161
|
-
return result;
|
|
161
|
+
return getInt32Memory0().subarray(ptr / 4, ptr / 4 + len);
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* @param {string} fen_w
|
|
@@ -201,37 +201,37 @@ function handleError(f, args) {
|
|
|
201
201
|
}
|
|
202
202
|
/**
|
|
203
203
|
*/
|
|
204
|
-
module.exports.
|
|
204
|
+
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", });
|
|
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.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
211
211
|
/**
|
|
212
212
|
*/
|
|
213
|
-
module.exports.
|
|
213
|
+
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", });
|
|
214
214
|
/**
|
|
215
215
|
*/
|
|
216
|
-
module.exports.
|
|
216
|
+
module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
217
217
|
/**
|
|
218
218
|
*/
|
|
219
|
-
module.exports.
|
|
219
|
+
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", });
|
|
220
220
|
/**
|
|
221
221
|
*/
|
|
222
|
-
module.exports.
|
|
222
|
+
module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
223
223
|
/**
|
|
224
224
|
*/
|
|
225
|
-
module.exports.
|
|
225
|
+
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", });
|
|
226
226
|
/**
|
|
227
227
|
*/
|
|
228
228
|
module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
229
229
|
/**
|
|
230
230
|
*/
|
|
231
|
-
module.exports.
|
|
231
|
+
module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
232
232
|
/**
|
|
233
233
|
*/
|
|
234
|
-
module.exports.
|
|
234
|
+
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", });
|
|
235
235
|
|
|
236
236
|
const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
237
237
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -651,14 +651,26 @@ class Mon {
|
|
|
651
651
|
* @returns {number}
|
|
652
652
|
*/
|
|
653
653
|
get cooldown() {
|
|
654
|
-
const ret = wasm.
|
|
654
|
+
const ret = wasm.__wbg_get_location_i(this.__wbg_ptr);
|
|
655
655
|
return ret;
|
|
656
656
|
}
|
|
657
657
|
/**
|
|
658
658
|
* @param {number} arg0
|
|
659
659
|
*/
|
|
660
660
|
set cooldown(arg0) {
|
|
661
|
-
wasm.
|
|
661
|
+
wasm.__wbg_set_location_i(this.__wbg_ptr, arg0);
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* @returns {boolean}
|
|
665
|
+
*/
|
|
666
|
+
is_fainted() {
|
|
667
|
+
const ret = wasm.mon_is_fainted(this.__wbg_ptr);
|
|
668
|
+
return ret !== 0;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
*/
|
|
672
|
+
decrease_cooldown() {
|
|
673
|
+
wasm.mon_decrease_cooldown(this.__wbg_ptr);
|
|
662
674
|
}
|
|
663
675
|
/**
|
|
664
676
|
* @param {MonKind} kind
|
|
@@ -671,22 +683,10 @@ class Mon {
|
|
|
671
683
|
return Mon.__wrap(ret);
|
|
672
684
|
}
|
|
673
685
|
/**
|
|
674
|
-
* @returns {boolean}
|
|
675
|
-
*/
|
|
676
|
-
is_fainted() {
|
|
677
|
-
const ret = wasm.mon_is_fainted(this.__wbg_ptr);
|
|
678
|
-
return ret !== 0;
|
|
679
|
-
}
|
|
680
|
-
/**
|
|
681
686
|
*/
|
|
682
687
|
faint() {
|
|
683
688
|
wasm.mon_faint(this.__wbg_ptr);
|
|
684
689
|
}
|
|
685
|
-
/**
|
|
686
|
-
*/
|
|
687
|
-
decrease_cooldown() {
|
|
688
|
-
wasm.mon_decrease_cooldown(this.__wbg_ptr);
|
|
689
|
-
}
|
|
690
690
|
}
|
|
691
691
|
module.exports.Mon = Mon;
|
|
692
692
|
|
|
@@ -717,61 +717,78 @@ class MonsGameModel {
|
|
|
717
717
|
wasm.__wbg_monsgamemodel_free(ptr);
|
|
718
718
|
}
|
|
719
719
|
/**
|
|
720
|
-
* @returns {
|
|
720
|
+
* @returns {number}
|
|
721
721
|
*/
|
|
722
|
-
|
|
723
|
-
const ret = wasm.
|
|
724
|
-
return
|
|
722
|
+
black_score() {
|
|
723
|
+
const ret = wasm.monsgamemodel_black_score(this.__wbg_ptr);
|
|
724
|
+
return ret;
|
|
725
725
|
}
|
|
726
726
|
/**
|
|
727
|
-
* @param {
|
|
728
|
-
* @returns {MonsGameModel | undefined}
|
|
727
|
+
* @param {Location} location
|
|
729
728
|
*/
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
729
|
+
remove_item(location) {
|
|
730
|
+
_assertClass(location, Location);
|
|
731
|
+
var ptr0 = location.__destroy_into_raw();
|
|
732
|
+
wasm.monsgamemodel_remove_item(this.__wbg_ptr, ptr0);
|
|
735
733
|
}
|
|
736
734
|
/**
|
|
737
|
-
* @returns {
|
|
735
|
+
* @returns {number}
|
|
738
736
|
*/
|
|
739
|
-
|
|
740
|
-
const ret = wasm.
|
|
741
|
-
return ret
|
|
737
|
+
turn_number() {
|
|
738
|
+
const ret = wasm.monsgamemodel_turn_number(this.__wbg_ptr);
|
|
739
|
+
return ret;
|
|
742
740
|
}
|
|
743
741
|
/**
|
|
744
|
-
* @returns {
|
|
742
|
+
* @returns {number}
|
|
745
743
|
*/
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
try {
|
|
750
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
751
|
-
wasm.monsgamemodel_fen(retptr, this.__wbg_ptr);
|
|
752
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
753
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
754
|
-
deferred1_0 = r0;
|
|
755
|
-
deferred1_1 = r1;
|
|
756
|
-
return getStringFromWasm0(r0, r1);
|
|
757
|
-
} finally {
|
|
758
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
759
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
760
|
-
}
|
|
744
|
+
white_score() {
|
|
745
|
+
const ret = wasm.monsgamemodel_white_score(this.__wbg_ptr);
|
|
746
|
+
return ret;
|
|
761
747
|
}
|
|
762
748
|
/**
|
|
763
|
-
* @returns {
|
|
749
|
+
* @returns {Color}
|
|
764
750
|
*/
|
|
765
|
-
|
|
766
|
-
const ret = wasm.
|
|
767
|
-
return
|
|
751
|
+
active_color() {
|
|
752
|
+
const ret = wasm.monsgamemodel_active_color(this.__wbg_ptr);
|
|
753
|
+
return ret;
|
|
768
754
|
}
|
|
769
755
|
/**
|
|
770
|
-
* @
|
|
756
|
+
* @param {Color} color
|
|
757
|
+
* @returns {boolean}
|
|
771
758
|
*/
|
|
772
|
-
|
|
773
|
-
const ret = wasm.
|
|
774
|
-
return
|
|
759
|
+
can_takeback(color) {
|
|
760
|
+
const ret = wasm.monsgamemodel_can_takeback(this.__wbg_ptr, color);
|
|
761
|
+
return ret !== 0;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* @param {string} flat_moves_string_w
|
|
765
|
+
* @param {string} flat_moves_string_b
|
|
766
|
+
* @returns {boolean}
|
|
767
|
+
*/
|
|
768
|
+
verify_moves(flat_moves_string_w, flat_moves_string_b) {
|
|
769
|
+
const ptr0 = passStringToWasm0(flat_moves_string_w, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
770
|
+
const len0 = WASM_VECTOR_LEN;
|
|
771
|
+
const ptr1 = passStringToWasm0(flat_moves_string_b, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
772
|
+
const len1 = WASM_VECTOR_LEN;
|
|
773
|
+
const ret = wasm.monsgamemodel_verify_moves(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
774
|
+
return ret !== 0;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* @returns {Color | undefined}
|
|
778
|
+
*/
|
|
779
|
+
winner_color() {
|
|
780
|
+
const ret = wasm.monsgamemodel_winner_color(this.__wbg_ptr);
|
|
781
|
+
return ret === 2 ? undefined : ret;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* @param {string} other_fen
|
|
785
|
+
* @returns {boolean}
|
|
786
|
+
*/
|
|
787
|
+
is_later_than(other_fen) {
|
|
788
|
+
const ptr0 = passStringToWasm0(other_fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
789
|
+
const len0 = WASM_VECTOR_LEN;
|
|
790
|
+
const ret = wasm.monsgamemodel_is_later_than(this.__wbg_ptr, ptr0, len0);
|
|
791
|
+
return ret !== 0;
|
|
775
792
|
}
|
|
776
793
|
/**
|
|
777
794
|
* @param {(Location)[]} locations
|
|
@@ -785,21 +802,36 @@ class MonsGameModel {
|
|
|
785
802
|
return OutputModel.__wrap(ret);
|
|
786
803
|
}
|
|
787
804
|
/**
|
|
788
|
-
* @
|
|
789
|
-
* @returns {boolean}
|
|
805
|
+
* @returns {(string)[]}
|
|
790
806
|
*/
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
807
|
+
takeback_fens() {
|
|
808
|
+
try {
|
|
809
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
810
|
+
wasm.monsgamemodel_takeback_fens(retptr, this.__wbg_ptr);
|
|
811
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
812
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
813
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
814
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
815
|
+
return v1;
|
|
816
|
+
} finally {
|
|
817
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
818
|
+
}
|
|
794
819
|
}
|
|
795
820
|
/**
|
|
796
821
|
* @returns {OutputModel}
|
|
797
822
|
*/
|
|
798
|
-
|
|
799
|
-
const ret = wasm.
|
|
823
|
+
smart_automove() {
|
|
824
|
+
const ret = wasm.monsgamemodel_smart_automove(this.__wbg_ptr);
|
|
800
825
|
return OutputModel.__wrap(ret);
|
|
801
826
|
}
|
|
802
827
|
/**
|
|
828
|
+
* @returns {boolean}
|
|
829
|
+
*/
|
|
830
|
+
is_moves_verified() {
|
|
831
|
+
const ret = wasm.monsgamemodel_is_moves_verified(this.__wbg_ptr);
|
|
832
|
+
return ret !== 0;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
803
835
|
* @param {string} input_fen
|
|
804
836
|
* @returns {OutputModel}
|
|
805
837
|
*/
|
|
@@ -810,108 +842,41 @@ class MonsGameModel {
|
|
|
810
842
|
return OutputModel.__wrap(ret);
|
|
811
843
|
}
|
|
812
844
|
/**
|
|
813
|
-
* @param {
|
|
814
|
-
|
|
815
|
-
remove_item(location) {
|
|
816
|
-
_assertClass(location, Location);
|
|
817
|
-
var ptr0 = location.__destroy_into_raw();
|
|
818
|
-
wasm.monsgamemodel_remove_item(this.__wbg_ptr, ptr0);
|
|
819
|
-
}
|
|
820
|
-
/**
|
|
821
|
-
* @param {Location} at
|
|
822
|
-
* @returns {ItemModel | undefined}
|
|
845
|
+
* @param {(string)[]} takeback_fens
|
|
846
|
+
* @returns {MonsGameModel | undefined}
|
|
823
847
|
*/
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
const ret = wasm.
|
|
828
|
-
return ret === 0 ? undefined :
|
|
848
|
+
without_last_turn(takeback_fens) {
|
|
849
|
+
const ptr0 = passArrayJsValueToWasm0(takeback_fens, wasm.__wbindgen_malloc);
|
|
850
|
+
const len0 = WASM_VECTOR_LEN;
|
|
851
|
+
const ret = wasm.monsgamemodel_without_last_turn(this.__wbg_ptr, ptr0, len0);
|
|
852
|
+
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
829
853
|
}
|
|
830
854
|
/**
|
|
831
|
-
* @
|
|
832
|
-
* @returns {SquareModel}
|
|
855
|
+
* @returns {Int32Array}
|
|
833
856
|
*/
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
857
|
+
available_move_kinds() {
|
|
858
|
+
try {
|
|
859
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
860
|
+
wasm.monsgamemodel_available_move_kinds(retptr, this.__wbg_ptr);
|
|
861
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
862
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
863
|
+
var v1 = getArrayI32FromWasm0(r0, r1).slice();
|
|
864
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
865
|
+
return v1;
|
|
866
|
+
} finally {
|
|
867
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
868
|
+
}
|
|
839
869
|
}
|
|
840
870
|
/**
|
|
841
|
-
* @
|
|
842
|
-
* @returns {boolean}
|
|
871
|
+
* @returns {(Location)[]}
|
|
843
872
|
*/
|
|
844
|
-
|
|
845
|
-
const ptr0 = passStringToWasm0(other_fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
846
|
-
const len0 = WASM_VECTOR_LEN;
|
|
847
|
-
const ret = wasm.monsgamemodel_is_later_than(this.__wbg_ptr, ptr0, len0);
|
|
848
|
-
return ret !== 0;
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* @returns {boolean}
|
|
852
|
-
*/
|
|
853
|
-
is_moves_verified() {
|
|
854
|
-
const ret = wasm.monsgamemodel_is_moves_verified(this.__wbg_ptr);
|
|
855
|
-
return ret !== 0;
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
* @param {string} flat_moves_string_w
|
|
859
|
-
* @param {string} flat_moves_string_b
|
|
860
|
-
* @returns {boolean}
|
|
861
|
-
*/
|
|
862
|
-
verify_moves(flat_moves_string_w, flat_moves_string_b) {
|
|
863
|
-
const ptr0 = passStringToWasm0(flat_moves_string_w, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
864
|
-
const len0 = WASM_VECTOR_LEN;
|
|
865
|
-
const ptr1 = passStringToWasm0(flat_moves_string_b, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
866
|
-
const len1 = WASM_VECTOR_LEN;
|
|
867
|
-
const ret = wasm.monsgamemodel_verify_moves(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
868
|
-
return ret !== 0;
|
|
869
|
-
}
|
|
870
|
-
/**
|
|
871
|
-
* @returns {Color}
|
|
872
|
-
*/
|
|
873
|
-
active_color() {
|
|
874
|
-
const ret = wasm.monsgamemodel_active_color(this.__wbg_ptr);
|
|
875
|
-
return ret;
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* @returns {Color | undefined}
|
|
879
|
-
*/
|
|
880
|
-
winner_color() {
|
|
881
|
-
const ret = wasm.monsgamemodel_winner_color(this.__wbg_ptr);
|
|
882
|
-
return ret === 2 ? undefined : ret;
|
|
883
|
-
}
|
|
884
|
-
/**
|
|
885
|
-
* @returns {number}
|
|
886
|
-
*/
|
|
887
|
-
black_score() {
|
|
888
|
-
const ret = wasm.monsgamemodel_black_score(this.__wbg_ptr);
|
|
889
|
-
return ret;
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* @returns {number}
|
|
893
|
-
*/
|
|
894
|
-
white_score() {
|
|
895
|
-
const ret = wasm.monsgamemodel_white_score(this.__wbg_ptr);
|
|
896
|
-
return ret;
|
|
897
|
-
}
|
|
898
|
-
/**
|
|
899
|
-
* @returns {number}
|
|
900
|
-
*/
|
|
901
|
-
turn_number() {
|
|
902
|
-
const ret = wasm.monsgamemodel_turn_number(this.__wbg_ptr);
|
|
903
|
-
return ret;
|
|
904
|
-
}
|
|
905
|
-
/**
|
|
906
|
-
* @returns {Int32Array}
|
|
907
|
-
*/
|
|
908
|
-
inactive_player_items_counters() {
|
|
873
|
+
locations_with_content() {
|
|
909
874
|
try {
|
|
910
875
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
911
|
-
wasm.
|
|
876
|
+
wasm.monsgamemodel_locations_with_content(retptr, this.__wbg_ptr);
|
|
912
877
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
913
878
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
914
|
-
var v1 =
|
|
879
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
915
880
|
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
916
881
|
return v1;
|
|
917
882
|
} finally {
|
|
@@ -919,12 +884,12 @@ class MonsGameModel {
|
|
|
919
884
|
}
|
|
920
885
|
}
|
|
921
886
|
/**
|
|
922
|
-
* @returns {(
|
|
887
|
+
* @returns {(VerboseTrackingEntityModel)[]}
|
|
923
888
|
*/
|
|
924
|
-
|
|
889
|
+
verbose_tracking_entities() {
|
|
925
890
|
try {
|
|
926
891
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
927
|
-
wasm.
|
|
892
|
+
wasm.monsgamemodel_verbose_tracking_entities(retptr, this.__wbg_ptr);
|
|
928
893
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
929
894
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
930
895
|
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
@@ -937,10 +902,10 @@ class MonsGameModel {
|
|
|
937
902
|
/**
|
|
938
903
|
* @returns {Int32Array}
|
|
939
904
|
*/
|
|
940
|
-
|
|
905
|
+
inactive_player_items_counters() {
|
|
941
906
|
try {
|
|
942
907
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
943
|
-
wasm.
|
|
908
|
+
wasm.monsgamemodel_inactive_player_items_counters(retptr, this.__wbg_ptr);
|
|
944
909
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
945
910
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
946
911
|
var v1 = getArrayI32FromWasm0(r0, r1).slice();
|
|
@@ -951,36 +916,74 @@ class MonsGameModel {
|
|
|
951
916
|
}
|
|
952
917
|
}
|
|
953
918
|
/**
|
|
954
|
-
* @returns {
|
|
919
|
+
* @returns {string}
|
|
955
920
|
*/
|
|
956
|
-
|
|
921
|
+
fen() {
|
|
922
|
+
let deferred1_0;
|
|
923
|
+
let deferred1_1;
|
|
957
924
|
try {
|
|
958
925
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
959
|
-
wasm.
|
|
926
|
+
wasm.monsgamemodel_fen(retptr, this.__wbg_ptr);
|
|
960
927
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
961
928
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
return
|
|
929
|
+
deferred1_0 = r0;
|
|
930
|
+
deferred1_1 = r1;
|
|
931
|
+
return getStringFromWasm0(r0, r1);
|
|
965
932
|
} finally {
|
|
966
933
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
934
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
967
935
|
}
|
|
968
936
|
}
|
|
969
937
|
/**
|
|
970
|
-
* @returns {
|
|
938
|
+
* @returns {MonsGameModel}
|
|
971
939
|
*/
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
940
|
+
static new() {
|
|
941
|
+
const ret = wasm.monsgamemodel_new();
|
|
942
|
+
return MonsGameModel.__wrap(ret);
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* @param {Location} at
|
|
946
|
+
* @returns {ItemModel | undefined}
|
|
947
|
+
*/
|
|
948
|
+
item(at) {
|
|
949
|
+
_assertClass(at, Location);
|
|
950
|
+
var ptr0 = at.__destroy_into_raw();
|
|
951
|
+
const ret = wasm.monsgamemodel_item(this.__wbg_ptr, ptr0);
|
|
952
|
+
return ret === 0 ? undefined : ItemModel.__wrap(ret);
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* @param {Location} at
|
|
956
|
+
* @returns {SquareModel}
|
|
957
|
+
*/
|
|
958
|
+
square(at) {
|
|
959
|
+
_assertClass(at, Location);
|
|
960
|
+
var ptr0 = at.__destroy_into_raw();
|
|
961
|
+
const ret = wasm.monsgamemodel_square(this.__wbg_ptr, ptr0);
|
|
962
|
+
return SquareModel.__wrap(ret);
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* @returns {OutputModel}
|
|
966
|
+
*/
|
|
967
|
+
automove() {
|
|
968
|
+
const ret = wasm.monsgamemodel_automove(this.__wbg_ptr);
|
|
969
|
+
return OutputModel.__wrap(ret);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* @param {string} fen
|
|
973
|
+
* @returns {MonsGameModel | undefined}
|
|
974
|
+
*/
|
|
975
|
+
static from_fen(fen) {
|
|
976
|
+
const ptr0 = passStringToWasm0(fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
977
|
+
const len0 = WASM_VECTOR_LEN;
|
|
978
|
+
const ret = wasm.monsgamemodel_from_fen(ptr0, len0);
|
|
979
|
+
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* @returns {OutputModel}
|
|
983
|
+
*/
|
|
984
|
+
takeback() {
|
|
985
|
+
const ret = wasm.monsgamemodel_takeback(this.__wbg_ptr);
|
|
986
|
+
return OutputModel.__wrap(ret);
|
|
984
987
|
}
|
|
985
988
|
}
|
|
986
989
|
module.exports.MonsGameModel = MonsGameModel;
|
|
@@ -1103,35 +1106,6 @@ class OutputModel {
|
|
|
1103
1106
|
wasm.__wbg_outputmodel_free(ptr);
|
|
1104
1107
|
}
|
|
1105
1108
|
/**
|
|
1106
|
-
* @returns {OutputModelKind}
|
|
1107
|
-
*/
|
|
1108
|
-
get kind() {
|
|
1109
|
-
const ret = wasm.__wbg_get_outputmodel_kind(this.__wbg_ptr);
|
|
1110
|
-
return ret;
|
|
1111
|
-
}
|
|
1112
|
-
/**
|
|
1113
|
-
* @param {OutputModelKind} arg0
|
|
1114
|
-
*/
|
|
1115
|
-
set kind(arg0) {
|
|
1116
|
-
wasm.__wbg_set_outputmodel_kind(this.__wbg_ptr, arg0);
|
|
1117
|
-
}
|
|
1118
|
-
/**
|
|
1119
|
-
* @returns {(Location)[]}
|
|
1120
|
-
*/
|
|
1121
|
-
locations() {
|
|
1122
|
-
try {
|
|
1123
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1124
|
-
wasm.outputmodel_locations(retptr, this.__wbg_ptr);
|
|
1125
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1126
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1127
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1128
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1129
|
-
return v1;
|
|
1130
|
-
} finally {
|
|
1131
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
1109
|
* @returns {(NextInputModel)[]}
|
|
1136
1110
|
*/
|
|
1137
1111
|
next_inputs() {
|
|
@@ -1182,6 +1156,35 @@ class OutputModel {
|
|
|
1182
1156
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1183
1157
|
}
|
|
1184
1158
|
}
|
|
1159
|
+
/**
|
|
1160
|
+
* @returns {(Location)[]}
|
|
1161
|
+
*/
|
|
1162
|
+
locations() {
|
|
1163
|
+
try {
|
|
1164
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1165
|
+
wasm.outputmodel_locations(retptr, this.__wbg_ptr);
|
|
1166
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1167
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1168
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1169
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1170
|
+
return v1;
|
|
1171
|
+
} finally {
|
|
1172
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* @returns {OutputModelKind}
|
|
1177
|
+
*/
|
|
1178
|
+
get kind() {
|
|
1179
|
+
const ret = wasm.__wbg_get_outputmodel_kind(this.__wbg_ptr);
|
|
1180
|
+
return ret;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* @param {OutputModelKind} arg0
|
|
1184
|
+
*/
|
|
1185
|
+
set kind(arg0) {
|
|
1186
|
+
wasm.__wbg_set_outputmodel_kind(this.__wbg_ptr, arg0);
|
|
1187
|
+
}
|
|
1185
1188
|
}
|
|
1186
1189
|
module.exports.OutputModel = OutputModel;
|
|
1187
1190
|
|
|
@@ -1282,12 +1285,12 @@ class VerboseTrackingEntityModel {
|
|
|
1282
1285
|
/**
|
|
1283
1286
|
* @returns {string}
|
|
1284
1287
|
*/
|
|
1285
|
-
|
|
1288
|
+
events_fen() {
|
|
1286
1289
|
let deferred1_0;
|
|
1287
1290
|
let deferred1_1;
|
|
1288
1291
|
try {
|
|
1289
1292
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1290
|
-
wasm.
|
|
1293
|
+
wasm.verbosetrackingentitymodel_events_fen(retptr, this.__wbg_ptr);
|
|
1291
1294
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1292
1295
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1293
1296
|
deferred1_0 = r0;
|
|
@@ -1299,38 +1302,45 @@ class VerboseTrackingEntityModel {
|
|
|
1299
1302
|
}
|
|
1300
1303
|
}
|
|
1301
1304
|
/**
|
|
1302
|
-
* @returns {
|
|
1305
|
+
* @returns {string}
|
|
1303
1306
|
*/
|
|
1304
|
-
|
|
1307
|
+
fen() {
|
|
1308
|
+
let deferred1_0;
|
|
1309
|
+
let deferred1_1;
|
|
1305
1310
|
try {
|
|
1306
1311
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1307
|
-
wasm.
|
|
1312
|
+
wasm.verbosetrackingentitymodel_fen(retptr, this.__wbg_ptr);
|
|
1308
1313
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1309
1314
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
return
|
|
1315
|
+
deferred1_0 = r0;
|
|
1316
|
+
deferred1_1 = r1;
|
|
1317
|
+
return getStringFromWasm0(r0, r1);
|
|
1313
1318
|
} finally {
|
|
1314
1319
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1320
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1315
1321
|
}
|
|
1316
1322
|
}
|
|
1317
1323
|
/**
|
|
1318
|
-
* @returns {
|
|
1324
|
+
* @returns {Color}
|
|
1319
1325
|
*/
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1326
|
+
color() {
|
|
1327
|
+
const ret = wasm.verbosetrackingentitymodel_color(this.__wbg_ptr);
|
|
1328
|
+
return ret;
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* @returns {(EventModel)[]}
|
|
1332
|
+
*/
|
|
1333
|
+
events() {
|
|
1323
1334
|
try {
|
|
1324
1335
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1325
|
-
wasm.
|
|
1336
|
+
wasm.verbosetrackingentitymodel_events(retptr, this.__wbg_ptr);
|
|
1326
1337
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1327
1338
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
return
|
|
1339
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1340
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1341
|
+
return v1;
|
|
1331
1342
|
} finally {
|
|
1332
1343
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1333
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1334
1344
|
}
|
|
1335
1345
|
}
|
|
1336
1346
|
}
|
|
@@ -1429,13 +1439,41 @@ module.exports.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
|
|
1429
1439
|
return addHeapObject(ret);
|
|
1430
1440
|
};
|
|
1431
1441
|
|
|
1432
|
-
module.exports.
|
|
1433
|
-
const ret = getObject(arg0)
|
|
1442
|
+
module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
1443
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
1434
1444
|
return addHeapObject(ret);
|
|
1435
|
-
}
|
|
1445
|
+
};
|
|
1436
1446
|
|
|
1437
|
-
module.exports.
|
|
1438
|
-
const
|
|
1447
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1448
|
+
const obj = getObject(arg1);
|
|
1449
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1450
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1451
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1452
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
1453
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1456
|
+
module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
1457
|
+
const ret = getObject(arg0).buffer;
|
|
1458
|
+
return addHeapObject(ret);
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1461
|
+
module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
1462
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
1463
|
+
return addHeapObject(ret);
|
|
1464
|
+
};
|
|
1465
|
+
|
|
1466
|
+
module.exports.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
1467
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
1468
|
+
return addHeapObject(ret);
|
|
1469
|
+
};
|
|
1470
|
+
|
|
1471
|
+
module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
1472
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1473
|
+
};
|
|
1474
|
+
|
|
1475
|
+
module.exports.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
|
1476
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1439
1477
|
return addHeapObject(ret);
|
|
1440
1478
|
};
|
|
1441
1479
|
|
|
@@ -1464,37 +1502,23 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
|
1464
1502
|
return ret;
|
|
1465
1503
|
};
|
|
1466
1504
|
|
|
1467
|
-
module.exports.
|
|
1468
|
-
const ret = getObject(arg0).call(getObject(arg1)
|
|
1505
|
+
module.exports.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
|
1506
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
1469
1507
|
return addHeapObject(ret);
|
|
1470
1508
|
}, arguments) };
|
|
1471
1509
|
|
|
1472
|
-
module.exports.
|
|
1473
|
-
const ret = getObject(arg0)
|
|
1474
|
-
return addHeapObject(ret);
|
|
1475
|
-
};
|
|
1476
|
-
|
|
1477
|
-
module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
1478
|
-
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
1479
|
-
return addHeapObject(ret);
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
1483
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
1510
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1511
|
+
const ret = getObject(arg0);
|
|
1484
1512
|
return addHeapObject(ret);
|
|
1485
1513
|
};
|
|
1486
1514
|
|
|
1487
|
-
module.exports.
|
|
1488
|
-
getObject(arg0).
|
|
1489
|
-
};
|
|
1490
|
-
|
|
1491
|
-
module.exports.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
1492
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
1515
|
+
module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1516
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1493
1517
|
return addHeapObject(ret);
|
|
1494
|
-
};
|
|
1518
|
+
}, arguments) };
|
|
1495
1519
|
|
|
1496
|
-
module.exports.
|
|
1497
|
-
const ret =
|
|
1520
|
+
module.exports.__wbindgen_memory = function() {
|
|
1521
|
+
const ret = wasm.memory;
|
|
1498
1522
|
return addHeapObject(ret);
|
|
1499
1523
|
};
|
|
1500
1524
|
|
|
@@ -1502,11 +1526,6 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
|
1502
1526
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1503
1527
|
};
|
|
1504
1528
|
|
|
1505
|
-
module.exports.__wbindgen_memory = function() {
|
|
1506
|
-
const ret = wasm.memory;
|
|
1507
|
-
return addHeapObject(ret);
|
|
1508
|
-
};
|
|
1509
|
-
|
|
1510
1529
|
const path = require('path').join(__dirname, 'mons-rust_bg.wasm');
|
|
1511
1530
|
const bytes = require('fs').readFileSync(path);
|
|
1512
1531
|
|
package/mons-rust_bg.wasm
CHANGED
|
Binary file
|