mons-rust 0.1.133 → 0.2.0
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/README.md +88 -46
- package/mons-rust-internal.cjs +1 -0
- package/mons-rust.d.ts +65 -65
- package/mons-rust.js +33 -1583
- package/package.json +6 -4
- package/mons-rust_bg.wasm +0 -0
package/mons-rust.js
CHANGED
|
@@ -1,1584 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
35
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
36
|
-
}
|
|
37
|
-
return cachedUint8Memory0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function getStringFromWasm0(ptr, len) {
|
|
41
|
-
ptr = ptr >>> 0;
|
|
42
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function addHeapObject(obj) {
|
|
46
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
|
-
const idx = heap_next;
|
|
48
|
-
heap_next = heap[idx];
|
|
49
|
-
|
|
50
|
-
heap[idx] = obj;
|
|
51
|
-
return idx;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let WASM_VECTOR_LEN = 0;
|
|
55
|
-
|
|
56
|
-
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
57
|
-
|
|
58
|
-
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
59
|
-
? function (arg, view) {
|
|
60
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
61
|
-
}
|
|
62
|
-
: function (arg, view) {
|
|
63
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
64
|
-
view.set(buf);
|
|
65
|
-
return {
|
|
66
|
-
read: arg.length,
|
|
67
|
-
written: buf.length
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
72
|
-
|
|
73
|
-
if (realloc === undefined) {
|
|
74
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
75
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
76
|
-
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
77
|
-
WASM_VECTOR_LEN = buf.length;
|
|
78
|
-
return ptr;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
let len = arg.length;
|
|
82
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
83
|
-
|
|
84
|
-
const mem = getUint8Memory0();
|
|
85
|
-
|
|
86
|
-
let offset = 0;
|
|
87
|
-
|
|
88
|
-
for (; offset < len; offset++) {
|
|
89
|
-
const code = arg.charCodeAt(offset);
|
|
90
|
-
if (code > 0x7F) break;
|
|
91
|
-
mem[ptr + offset] = code;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (offset !== len) {
|
|
95
|
-
if (offset !== 0) {
|
|
96
|
-
arg = arg.slice(offset);
|
|
97
|
-
}
|
|
98
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
99
|
-
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
100
|
-
const ret = encodeString(arg, view);
|
|
101
|
-
|
|
102
|
-
offset += ret.written;
|
|
103
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
WASM_VECTOR_LEN = offset;
|
|
107
|
-
return ptr;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function isLikeNone(x) {
|
|
111
|
-
return x === undefined || x === null;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
let cachedInt32Memory0 = null;
|
|
115
|
-
|
|
116
|
-
function getInt32Memory0() {
|
|
117
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
118
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
119
|
-
}
|
|
120
|
-
return cachedInt32Memory0;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* @param {string} fen_w
|
|
124
|
-
* @param {string} fen_b
|
|
125
|
-
* @param {string} flat_moves_string_w
|
|
126
|
-
* @param {string} flat_moves_string_b
|
|
127
|
-
* @returns {string}
|
|
128
|
-
*/
|
|
129
|
-
module.exports.winner = function(fen_w, fen_b, flat_moves_string_w, flat_moves_string_b) {
|
|
130
|
-
let deferred5_0;
|
|
131
|
-
let deferred5_1;
|
|
132
|
-
try {
|
|
133
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
134
|
-
const ptr0 = passStringToWasm0(fen_w, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
135
|
-
const len0 = WASM_VECTOR_LEN;
|
|
136
|
-
const ptr1 = passStringToWasm0(fen_b, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
137
|
-
const len1 = WASM_VECTOR_LEN;
|
|
138
|
-
const ptr2 = passStringToWasm0(flat_moves_string_w, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
139
|
-
const len2 = WASM_VECTOR_LEN;
|
|
140
|
-
const ptr3 = passStringToWasm0(flat_moves_string_b, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
141
|
-
const len3 = WASM_VECTOR_LEN;
|
|
142
|
-
wasm.winner(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
143
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
144
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
145
|
-
deferred5_0 = r0;
|
|
146
|
-
deferred5_1 = r1;
|
|
147
|
-
return getStringFromWasm0(r0, r1);
|
|
148
|
-
} finally {
|
|
149
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
150
|
-
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
let cachedUint32Memory0 = null;
|
|
155
|
-
|
|
156
|
-
function getUint32Memory0() {
|
|
157
|
-
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
|
158
|
-
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
159
|
-
}
|
|
160
|
-
return cachedUint32Memory0;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
164
|
-
ptr = ptr >>> 0;
|
|
165
|
-
const mem = getUint32Memory0();
|
|
166
|
-
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
|
167
|
-
const result = [];
|
|
168
|
-
for (let i = 0; i < slice.length; i++) {
|
|
169
|
-
result.push(takeObject(slice[i]));
|
|
170
|
-
}
|
|
171
|
-
return result;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function _assertClass(instance, klass) {
|
|
175
|
-
if (!(instance instanceof klass)) {
|
|
176
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
177
|
-
}
|
|
178
|
-
return instance.ptr;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
182
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
183
|
-
const mem = getUint32Memory0();
|
|
184
|
-
for (let i = 0; i < array.length; i++) {
|
|
185
|
-
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
186
|
-
}
|
|
187
|
-
WASM_VECTOR_LEN = array.length;
|
|
188
|
-
return ptr;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function getArrayI32FromWasm0(ptr, len) {
|
|
192
|
-
ptr = ptr >>> 0;
|
|
193
|
-
return getInt32Memory0().subarray(ptr / 4, ptr / 4 + len);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function handleError(f, args) {
|
|
197
|
-
try {
|
|
198
|
-
return f.apply(this, args);
|
|
199
|
-
} catch (e) {
|
|
200
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
*/
|
|
205
|
-
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", });
|
|
206
|
-
/**
|
|
207
|
-
*/
|
|
208
|
-
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", });
|
|
209
|
-
/**
|
|
210
|
-
*/
|
|
211
|
-
module.exports.Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
212
|
-
/**
|
|
213
|
-
*/
|
|
214
|
-
module.exports.OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
|
|
215
|
-
/**
|
|
216
|
-
*/
|
|
217
|
-
module.exports.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",BentCenterManaRows:7,"7":"BentCenterManaRows",OuterEdgeManaRows:8,"8":"OuterEdgeManaRows",SplitFlankManaRows:9,"9":"SplitFlankManaRows",ForwardBridgeManaRows:10,"10":"ForwardBridgeManaRows",CornerChainManaRows:11,"11":"CornerChainManaRows", });
|
|
218
|
-
/**
|
|
219
|
-
*/
|
|
220
|
-
module.exports.Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
|
|
221
|
-
/**
|
|
222
|
-
*/
|
|
223
|
-
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", });
|
|
224
|
-
/**
|
|
225
|
-
*/
|
|
226
|
-
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", });
|
|
227
|
-
/**
|
|
228
|
-
*/
|
|
229
|
-
module.exports.ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
|
|
230
|
-
/**
|
|
231
|
-
*/
|
|
232
|
-
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", });
|
|
233
|
-
/**
|
|
234
|
-
*/
|
|
235
|
-
module.exports.AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
|
|
236
|
-
/**
|
|
237
|
-
*/
|
|
238
|
-
module.exports.Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
239
|
-
|
|
240
|
-
const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
241
|
-
? { register: () => {}, unregister: () => {} }
|
|
242
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_eventmodel_free(ptr >>> 0));
|
|
243
|
-
/**
|
|
244
|
-
*/
|
|
245
|
-
class EventModel {
|
|
246
|
-
|
|
247
|
-
static __wrap(ptr) {
|
|
248
|
-
ptr = ptr >>> 0;
|
|
249
|
-
const obj = Object.create(EventModel.prototype);
|
|
250
|
-
obj.__wbg_ptr = ptr;
|
|
251
|
-
EventModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
252
|
-
return obj;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
__destroy_into_raw() {
|
|
256
|
-
const ptr = this.__wbg_ptr;
|
|
257
|
-
this.__wbg_ptr = 0;
|
|
258
|
-
EventModelFinalization.unregister(this);
|
|
259
|
-
return ptr;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
free() {
|
|
263
|
-
const ptr = this.__destroy_into_raw();
|
|
264
|
-
wasm.__wbg_eventmodel_free(ptr);
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* @returns {EventModelKind}
|
|
268
|
-
*/
|
|
269
|
-
get kind() {
|
|
270
|
-
const ret = wasm.__wbg_get_eventmodel_kind(this.__wbg_ptr);
|
|
271
|
-
return ret;
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* @param {EventModelKind} arg0
|
|
275
|
-
*/
|
|
276
|
-
set kind(arg0) {
|
|
277
|
-
wasm.__wbg_set_eventmodel_kind(this.__wbg_ptr, arg0);
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* @returns {ItemModel | undefined}
|
|
281
|
-
*/
|
|
282
|
-
get item() {
|
|
283
|
-
const ret = wasm.__wbg_get_eventmodel_item(this.__wbg_ptr);
|
|
284
|
-
return ret === 0 ? undefined : ItemModel.__wrap(ret);
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* @param {ItemModel | undefined} [arg0]
|
|
288
|
-
*/
|
|
289
|
-
set item(arg0) {
|
|
290
|
-
let ptr0 = 0;
|
|
291
|
-
if (!isLikeNone(arg0)) {
|
|
292
|
-
_assertClass(arg0, ItemModel);
|
|
293
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
294
|
-
}
|
|
295
|
-
wasm.__wbg_set_eventmodel_item(this.__wbg_ptr, ptr0);
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* @returns {Mon | undefined}
|
|
299
|
-
*/
|
|
300
|
-
get mon() {
|
|
301
|
-
const ret = wasm.__wbg_get_eventmodel_mon(this.__wbg_ptr);
|
|
302
|
-
return ret === 0 ? undefined : Mon.__wrap(ret);
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* @param {Mon | undefined} [arg0]
|
|
306
|
-
*/
|
|
307
|
-
set mon(arg0) {
|
|
308
|
-
let ptr0 = 0;
|
|
309
|
-
if (!isLikeNone(arg0)) {
|
|
310
|
-
_assertClass(arg0, Mon);
|
|
311
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
312
|
-
}
|
|
313
|
-
wasm.__wbg_set_eventmodel_mon(this.__wbg_ptr, ptr0);
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* @returns {ManaModel | undefined}
|
|
317
|
-
*/
|
|
318
|
-
get mana() {
|
|
319
|
-
const ret = wasm.__wbg_get_eventmodel_mana(this.__wbg_ptr);
|
|
320
|
-
return ret === 0 ? undefined : ManaModel.__wrap(ret);
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* @param {ManaModel | undefined} [arg0]
|
|
324
|
-
*/
|
|
325
|
-
set mana(arg0) {
|
|
326
|
-
let ptr0 = 0;
|
|
327
|
-
if (!isLikeNone(arg0)) {
|
|
328
|
-
_assertClass(arg0, ManaModel);
|
|
329
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
330
|
-
}
|
|
331
|
-
wasm.__wbg_set_eventmodel_mana(this.__wbg_ptr, ptr0);
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* @returns {Location | undefined}
|
|
335
|
-
*/
|
|
336
|
-
get loc1() {
|
|
337
|
-
const ret = wasm.__wbg_get_eventmodel_loc1(this.__wbg_ptr);
|
|
338
|
-
return ret === 0 ? undefined : Location.__wrap(ret);
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* @param {Location | undefined} [arg0]
|
|
342
|
-
*/
|
|
343
|
-
set loc1(arg0) {
|
|
344
|
-
let ptr0 = 0;
|
|
345
|
-
if (!isLikeNone(arg0)) {
|
|
346
|
-
_assertClass(arg0, Location);
|
|
347
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
348
|
-
}
|
|
349
|
-
wasm.__wbg_set_eventmodel_loc1(this.__wbg_ptr, ptr0);
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* @returns {Location | undefined}
|
|
353
|
-
*/
|
|
354
|
-
get loc2() {
|
|
355
|
-
const ret = wasm.__wbg_get_eventmodel_loc2(this.__wbg_ptr);
|
|
356
|
-
return ret === 0 ? undefined : Location.__wrap(ret);
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* @param {Location | undefined} [arg0]
|
|
360
|
-
*/
|
|
361
|
-
set loc2(arg0) {
|
|
362
|
-
let ptr0 = 0;
|
|
363
|
-
if (!isLikeNone(arg0)) {
|
|
364
|
-
_assertClass(arg0, Location);
|
|
365
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
366
|
-
}
|
|
367
|
-
wasm.__wbg_set_eventmodel_loc2(this.__wbg_ptr, ptr0);
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* @returns {Color | undefined}
|
|
371
|
-
*/
|
|
372
|
-
get color() {
|
|
373
|
-
const ret = wasm.__wbg_get_eventmodel_color(this.__wbg_ptr);
|
|
374
|
-
return ret === 2 ? undefined : ret;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* @param {Color | undefined} [arg0]
|
|
378
|
-
*/
|
|
379
|
-
set color(arg0) {
|
|
380
|
-
wasm.__wbg_set_eventmodel_color(this.__wbg_ptr, isLikeNone(arg0) ? 2 : arg0);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
module.exports.EventModel = EventModel;
|
|
384
|
-
|
|
385
|
-
const ItemModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
386
|
-
? { register: () => {}, unregister: () => {} }
|
|
387
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_itemmodel_free(ptr >>> 0));
|
|
388
|
-
/**
|
|
389
|
-
*/
|
|
390
|
-
class ItemModel {
|
|
391
|
-
|
|
392
|
-
static __wrap(ptr) {
|
|
393
|
-
ptr = ptr >>> 0;
|
|
394
|
-
const obj = Object.create(ItemModel.prototype);
|
|
395
|
-
obj.__wbg_ptr = ptr;
|
|
396
|
-
ItemModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
397
|
-
return obj;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
__destroy_into_raw() {
|
|
401
|
-
const ptr = this.__wbg_ptr;
|
|
402
|
-
this.__wbg_ptr = 0;
|
|
403
|
-
ItemModelFinalization.unregister(this);
|
|
404
|
-
return ptr;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
free() {
|
|
408
|
-
const ptr = this.__destroy_into_raw();
|
|
409
|
-
wasm.__wbg_itemmodel_free(ptr);
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* @returns {ItemModelKind}
|
|
413
|
-
*/
|
|
414
|
-
get kind() {
|
|
415
|
-
const ret = wasm.__wbg_get_itemmodel_kind(this.__wbg_ptr);
|
|
416
|
-
return ret;
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* @param {ItemModelKind} arg0
|
|
420
|
-
*/
|
|
421
|
-
set kind(arg0) {
|
|
422
|
-
wasm.__wbg_set_itemmodel_kind(this.__wbg_ptr, arg0);
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* @returns {Mon | undefined}
|
|
426
|
-
*/
|
|
427
|
-
get mon() {
|
|
428
|
-
const ret = wasm.__wbg_get_itemmodel_mon(this.__wbg_ptr);
|
|
429
|
-
return ret === 0 ? undefined : Mon.__wrap(ret);
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* @param {Mon | undefined} [arg0]
|
|
433
|
-
*/
|
|
434
|
-
set mon(arg0) {
|
|
435
|
-
let ptr0 = 0;
|
|
436
|
-
if (!isLikeNone(arg0)) {
|
|
437
|
-
_assertClass(arg0, Mon);
|
|
438
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
439
|
-
}
|
|
440
|
-
wasm.__wbg_set_itemmodel_mon(this.__wbg_ptr, ptr0);
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* @returns {ManaModel | undefined}
|
|
444
|
-
*/
|
|
445
|
-
get mana() {
|
|
446
|
-
const ret = wasm.__wbg_get_itemmodel_mana(this.__wbg_ptr);
|
|
447
|
-
return ret === 0 ? undefined : ManaModel.__wrap(ret);
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* @param {ManaModel | undefined} [arg0]
|
|
451
|
-
*/
|
|
452
|
-
set mana(arg0) {
|
|
453
|
-
let ptr0 = 0;
|
|
454
|
-
if (!isLikeNone(arg0)) {
|
|
455
|
-
_assertClass(arg0, ManaModel);
|
|
456
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
457
|
-
}
|
|
458
|
-
wasm.__wbg_set_itemmodel_mana(this.__wbg_ptr, ptr0);
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* @returns {Consumable | undefined}
|
|
462
|
-
*/
|
|
463
|
-
get consumable() {
|
|
464
|
-
const ret = wasm.__wbg_get_itemmodel_consumable(this.__wbg_ptr);
|
|
465
|
-
return ret === 3 ? undefined : ret;
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* @param {Consumable | undefined} [arg0]
|
|
469
|
-
*/
|
|
470
|
-
set consumable(arg0) {
|
|
471
|
-
wasm.__wbg_set_itemmodel_consumable(this.__wbg_ptr, isLikeNone(arg0) ? 3 : arg0);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
module.exports.ItemModel = ItemModel;
|
|
475
|
-
|
|
476
|
-
const LocationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
477
|
-
? { register: () => {}, unregister: () => {} }
|
|
478
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_location_free(ptr >>> 0));
|
|
479
|
-
/**
|
|
480
|
-
*/
|
|
481
|
-
class Location {
|
|
482
|
-
|
|
483
|
-
static __wrap(ptr) {
|
|
484
|
-
ptr = ptr >>> 0;
|
|
485
|
-
const obj = Object.create(Location.prototype);
|
|
486
|
-
obj.__wbg_ptr = ptr;
|
|
487
|
-
LocationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
488
|
-
return obj;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
static __unwrap(jsValue) {
|
|
492
|
-
if (!(jsValue instanceof Location)) {
|
|
493
|
-
return 0;
|
|
494
|
-
}
|
|
495
|
-
return jsValue.__destroy_into_raw();
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
__destroy_into_raw() {
|
|
499
|
-
const ptr = this.__wbg_ptr;
|
|
500
|
-
this.__wbg_ptr = 0;
|
|
501
|
-
LocationFinalization.unregister(this);
|
|
502
|
-
return ptr;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
free() {
|
|
506
|
-
const ptr = this.__destroy_into_raw();
|
|
507
|
-
wasm.__wbg_location_free(ptr);
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* @returns {number}
|
|
511
|
-
*/
|
|
512
|
-
get i() {
|
|
513
|
-
const ret = wasm.__wbg_get_location_i(this.__wbg_ptr);
|
|
514
|
-
return ret;
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* @param {number} arg0
|
|
518
|
-
*/
|
|
519
|
-
set i(arg0) {
|
|
520
|
-
wasm.__wbg_set_location_i(this.__wbg_ptr, arg0);
|
|
521
|
-
}
|
|
522
|
-
/**
|
|
523
|
-
* @returns {number}
|
|
524
|
-
*/
|
|
525
|
-
get j() {
|
|
526
|
-
const ret = wasm.__wbg_get_location_j(this.__wbg_ptr);
|
|
527
|
-
return ret;
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* @param {number} arg0
|
|
531
|
-
*/
|
|
532
|
-
set j(arg0) {
|
|
533
|
-
wasm.__wbg_set_location_j(this.__wbg_ptr, arg0);
|
|
534
|
-
}
|
|
535
|
-
/**
|
|
536
|
-
* @param {number} i
|
|
537
|
-
* @param {number} j
|
|
538
|
-
*/
|
|
539
|
-
constructor(i, j) {
|
|
540
|
-
const ret = wasm.location_new(i, j);
|
|
541
|
-
this.__wbg_ptr = ret >>> 0;
|
|
542
|
-
return this;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
module.exports.Location = Location;
|
|
546
|
-
|
|
547
|
-
const ManaModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
548
|
-
? { register: () => {}, unregister: () => {} }
|
|
549
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_manamodel_free(ptr >>> 0));
|
|
550
|
-
/**
|
|
551
|
-
*/
|
|
552
|
-
class ManaModel {
|
|
553
|
-
|
|
554
|
-
static __wrap(ptr) {
|
|
555
|
-
ptr = ptr >>> 0;
|
|
556
|
-
const obj = Object.create(ManaModel.prototype);
|
|
557
|
-
obj.__wbg_ptr = ptr;
|
|
558
|
-
ManaModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
559
|
-
return obj;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
__destroy_into_raw() {
|
|
563
|
-
const ptr = this.__wbg_ptr;
|
|
564
|
-
this.__wbg_ptr = 0;
|
|
565
|
-
ManaModelFinalization.unregister(this);
|
|
566
|
-
return ptr;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
free() {
|
|
570
|
-
const ptr = this.__destroy_into_raw();
|
|
571
|
-
wasm.__wbg_manamodel_free(ptr);
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* @returns {ManaKind}
|
|
575
|
-
*/
|
|
576
|
-
get kind() {
|
|
577
|
-
const ret = wasm.__wbg_get_manamodel_kind(this.__wbg_ptr);
|
|
578
|
-
return ret;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* @param {ManaKind} arg0
|
|
582
|
-
*/
|
|
583
|
-
set kind(arg0) {
|
|
584
|
-
wasm.__wbg_set_manamodel_kind(this.__wbg_ptr, arg0);
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* @returns {Color}
|
|
588
|
-
*/
|
|
589
|
-
get color() {
|
|
590
|
-
const ret = wasm.__wbg_get_manamodel_color(this.__wbg_ptr);
|
|
591
|
-
return ret;
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* @param {Color} arg0
|
|
595
|
-
*/
|
|
596
|
-
set color(arg0) {
|
|
597
|
-
wasm.__wbg_set_manamodel_color(this.__wbg_ptr, arg0);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
module.exports.ManaModel = ManaModel;
|
|
601
|
-
|
|
602
|
-
const MonFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
603
|
-
? { register: () => {}, unregister: () => {} }
|
|
604
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_mon_free(ptr >>> 0));
|
|
605
|
-
/**
|
|
606
|
-
*/
|
|
607
|
-
class Mon {
|
|
608
|
-
|
|
609
|
-
static __wrap(ptr) {
|
|
610
|
-
ptr = ptr >>> 0;
|
|
611
|
-
const obj = Object.create(Mon.prototype);
|
|
612
|
-
obj.__wbg_ptr = ptr;
|
|
613
|
-
MonFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
614
|
-
return obj;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
__destroy_into_raw() {
|
|
618
|
-
const ptr = this.__wbg_ptr;
|
|
619
|
-
this.__wbg_ptr = 0;
|
|
620
|
-
MonFinalization.unregister(this);
|
|
621
|
-
return ptr;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
free() {
|
|
625
|
-
const ptr = this.__destroy_into_raw();
|
|
626
|
-
wasm.__wbg_mon_free(ptr);
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* @returns {MonKind}
|
|
630
|
-
*/
|
|
631
|
-
get kind() {
|
|
632
|
-
const ret = wasm.__wbg_get_mon_kind(this.__wbg_ptr);
|
|
633
|
-
return ret;
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
* @param {MonKind} arg0
|
|
637
|
-
*/
|
|
638
|
-
set kind(arg0) {
|
|
639
|
-
wasm.__wbg_set_mon_kind(this.__wbg_ptr, arg0);
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* @returns {Color}
|
|
643
|
-
*/
|
|
644
|
-
get color() {
|
|
645
|
-
const ret = wasm.__wbg_get_mon_color(this.__wbg_ptr);
|
|
646
|
-
return ret;
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* @param {Color} arg0
|
|
650
|
-
*/
|
|
651
|
-
set color(arg0) {
|
|
652
|
-
wasm.__wbg_set_mon_color(this.__wbg_ptr, arg0);
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* @returns {number}
|
|
656
|
-
*/
|
|
657
|
-
get cooldown() {
|
|
658
|
-
const ret = wasm.__wbg_get_location_i(this.__wbg_ptr);
|
|
659
|
-
return ret;
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* @param {number} arg0
|
|
663
|
-
*/
|
|
664
|
-
set cooldown(arg0) {
|
|
665
|
-
wasm.__wbg_set_location_i(this.__wbg_ptr, arg0);
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* @returns {boolean}
|
|
669
|
-
*/
|
|
670
|
-
is_fainted() {
|
|
671
|
-
const ret = wasm.mon_is_fainted(this.__wbg_ptr);
|
|
672
|
-
return ret !== 0;
|
|
673
|
-
}
|
|
674
|
-
/**
|
|
675
|
-
*/
|
|
676
|
-
decrease_cooldown() {
|
|
677
|
-
wasm.mon_decrease_cooldown(this.__wbg_ptr);
|
|
678
|
-
}
|
|
679
|
-
/**
|
|
680
|
-
* @param {MonKind} kind
|
|
681
|
-
* @param {Color} color
|
|
682
|
-
* @param {number} cooldown
|
|
683
|
-
* @returns {Mon}
|
|
684
|
-
*/
|
|
685
|
-
static new(kind, color, cooldown) {
|
|
686
|
-
const ret = wasm.mon_new(kind, color, cooldown);
|
|
687
|
-
return Mon.__wrap(ret);
|
|
688
|
-
}
|
|
689
|
-
/**
|
|
690
|
-
*/
|
|
691
|
-
faint() {
|
|
692
|
-
wasm.mon_faint(this.__wbg_ptr);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
module.exports.Mon = Mon;
|
|
696
|
-
|
|
697
|
-
const MonsGameModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
698
|
-
? { register: () => {}, unregister: () => {} }
|
|
699
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_monsgamemodel_free(ptr >>> 0));
|
|
700
|
-
/**
|
|
701
|
-
*/
|
|
702
|
-
class MonsGameModel {
|
|
703
|
-
|
|
704
|
-
static __wrap(ptr) {
|
|
705
|
-
ptr = ptr >>> 0;
|
|
706
|
-
const obj = Object.create(MonsGameModel.prototype);
|
|
707
|
-
obj.__wbg_ptr = ptr;
|
|
708
|
-
MonsGameModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
709
|
-
return obj;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
__destroy_into_raw() {
|
|
713
|
-
const ptr = this.__wbg_ptr;
|
|
714
|
-
this.__wbg_ptr = 0;
|
|
715
|
-
MonsGameModelFinalization.unregister(this);
|
|
716
|
-
return ptr;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
free() {
|
|
720
|
-
const ptr = this.__destroy_into_raw();
|
|
721
|
-
wasm.__wbg_monsgamemodel_free(ptr);
|
|
722
|
-
}
|
|
723
|
-
/**
|
|
724
|
-
* @returns {number}
|
|
725
|
-
*/
|
|
726
|
-
black_score() {
|
|
727
|
-
const ret = wasm.monsgamemodel_black_score(this.__wbg_ptr);
|
|
728
|
-
return ret;
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* @param {Location} location
|
|
732
|
-
*/
|
|
733
|
-
remove_item(location) {
|
|
734
|
-
_assertClass(location, Location);
|
|
735
|
-
var ptr0 = location.__destroy_into_raw();
|
|
736
|
-
wasm.monsgamemodel_remove_item(this.__wbg_ptr, ptr0);
|
|
737
|
-
}
|
|
738
|
-
/**
|
|
739
|
-
* @returns {number}
|
|
740
|
-
*/
|
|
741
|
-
turn_number() {
|
|
742
|
-
const ret = wasm.monsgamemodel_turn_number(this.__wbg_ptr);
|
|
743
|
-
return ret;
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* @returns {number}
|
|
747
|
-
*/
|
|
748
|
-
white_score() {
|
|
749
|
-
const ret = wasm.monsgamemodel_white_score(this.__wbg_ptr);
|
|
750
|
-
return ret;
|
|
751
|
-
}
|
|
752
|
-
/**
|
|
753
|
-
* @returns {Color}
|
|
754
|
-
*/
|
|
755
|
-
active_color() {
|
|
756
|
-
const ret = wasm.monsgamemodel_active_color(this.__wbg_ptr);
|
|
757
|
-
return ret;
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* @param {Color} color
|
|
761
|
-
* @returns {boolean}
|
|
762
|
-
*/
|
|
763
|
-
can_takeback(color) {
|
|
764
|
-
const ret = wasm.monsgamemodel_can_takeback(this.__wbg_ptr, color);
|
|
765
|
-
return ret !== 0;
|
|
766
|
-
}
|
|
767
|
-
/**
|
|
768
|
-
* @param {string} flat_moves_string_w
|
|
769
|
-
* @param {string} flat_moves_string_b
|
|
770
|
-
* @returns {boolean}
|
|
771
|
-
*/
|
|
772
|
-
verify_moves(flat_moves_string_w, flat_moves_string_b) {
|
|
773
|
-
const ptr0 = passStringToWasm0(flat_moves_string_w, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
774
|
-
const len0 = WASM_VECTOR_LEN;
|
|
775
|
-
const ptr1 = passStringToWasm0(flat_moves_string_b, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
776
|
-
const len1 = WASM_VECTOR_LEN;
|
|
777
|
-
const ret = wasm.monsgamemodel_verify_moves(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
778
|
-
return ret !== 0;
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* @returns {Color | undefined}
|
|
782
|
-
*/
|
|
783
|
-
winner_color() {
|
|
784
|
-
const ret = wasm.monsgamemodel_winner_color(this.__wbg_ptr);
|
|
785
|
-
return ret === 2 ? undefined : ret;
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* @param {string} other_fen
|
|
789
|
-
* @returns {boolean}
|
|
790
|
-
*/
|
|
791
|
-
is_later_than(other_fen) {
|
|
792
|
-
const ptr0 = passStringToWasm0(other_fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
793
|
-
const len0 = WASM_VECTOR_LEN;
|
|
794
|
-
const ret = wasm.monsgamemodel_is_later_than(this.__wbg_ptr, ptr0, len0);
|
|
795
|
-
return ret !== 0;
|
|
796
|
-
}
|
|
797
|
-
/**
|
|
798
|
-
* @param {(Location)[]} locations
|
|
799
|
-
* @param {Modifier | undefined} [modifier]
|
|
800
|
-
* @returns {OutputModel}
|
|
801
|
-
*/
|
|
802
|
-
process_input(locations, modifier) {
|
|
803
|
-
const ptr0 = passArrayJsValueToWasm0(locations, wasm.__wbindgen_malloc);
|
|
804
|
-
const len0 = WASM_VECTOR_LEN;
|
|
805
|
-
const ret = wasm.monsgamemodel_process_input(this.__wbg_ptr, ptr0, len0, isLikeNone(modifier) ? 3 : modifier);
|
|
806
|
-
return OutputModel.__wrap(ret);
|
|
807
|
-
}
|
|
808
|
-
/**
|
|
809
|
-
* @returns {(string)[]}
|
|
810
|
-
*/
|
|
811
|
-
takeback_fens() {
|
|
812
|
-
try {
|
|
813
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
814
|
-
wasm.monsgamemodel_takeback_fens(retptr, this.__wbg_ptr);
|
|
815
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
816
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
817
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
818
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
819
|
-
return v1;
|
|
820
|
-
} finally {
|
|
821
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
*/
|
|
826
|
-
clearTracking() {
|
|
827
|
-
wasm.monsgamemodel_clearTracking(this.__wbg_ptr);
|
|
828
|
-
}
|
|
829
|
-
/**
|
|
830
|
-
* @param {string} preference
|
|
831
|
-
* @returns {OutputModel}
|
|
832
|
-
*/
|
|
833
|
-
smartAutomove(preference) {
|
|
834
|
-
try {
|
|
835
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
836
|
-
const ptr0 = passStringToWasm0(preference, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
837
|
-
const len0 = WASM_VECTOR_LEN;
|
|
838
|
-
wasm.monsgamemodel_smartAutomove(retptr, this.__wbg_ptr, ptr0, len0);
|
|
839
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
840
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
841
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
842
|
-
if (r2) {
|
|
843
|
-
throw takeObject(r1);
|
|
844
|
-
}
|
|
845
|
-
return OutputModel.__wrap(r0);
|
|
846
|
-
} finally {
|
|
847
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
848
|
-
}
|
|
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} input_fen
|
|
859
|
-
* @returns {OutputModel}
|
|
860
|
-
*/
|
|
861
|
-
process_input_fen(input_fen) {
|
|
862
|
-
const ptr0 = passStringToWasm0(input_fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
863
|
-
const len0 = WASM_VECTOR_LEN;
|
|
864
|
-
const ret = wasm.monsgamemodel_process_input_fen(this.__wbg_ptr, ptr0, len0);
|
|
865
|
-
return OutputModel.__wrap(ret);
|
|
866
|
-
}
|
|
867
|
-
/**
|
|
868
|
-
* @param {(string)[]} takeback_fens
|
|
869
|
-
* @returns {MonsGameModel | undefined}
|
|
870
|
-
*/
|
|
871
|
-
without_last_turn(takeback_fens) {
|
|
872
|
-
const ptr0 = passArrayJsValueToWasm0(takeback_fens, wasm.__wbindgen_malloc);
|
|
873
|
-
const len0 = WASM_VECTOR_LEN;
|
|
874
|
-
const ret = wasm.monsgamemodel_without_last_turn(this.__wbg_ptr, ptr0, len0);
|
|
875
|
-
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* @param {GameVariant} variant
|
|
879
|
-
* @returns {MonsGameModel}
|
|
880
|
-
*/
|
|
881
|
-
static newForSimulation(variant) {
|
|
882
|
-
const ret = wasm.monsgamemodel_newForSimulation(variant);
|
|
883
|
-
return MonsGameModel.__wrap(ret);
|
|
884
|
-
}
|
|
885
|
-
/**
|
|
886
|
-
* @returns {Int32Array}
|
|
887
|
-
*/
|
|
888
|
-
available_move_kinds() {
|
|
889
|
-
try {
|
|
890
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
891
|
-
wasm.monsgamemodel_available_move_kinds(retptr, this.__wbg_ptr);
|
|
892
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
893
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
894
|
-
var v1 = getArrayI32FromWasm0(r0, r1).slice();
|
|
895
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
896
|
-
return v1;
|
|
897
|
-
} finally {
|
|
898
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
/**
|
|
902
|
-
* @param {boolean} enabled
|
|
903
|
-
*/
|
|
904
|
-
setVerboseTracking(enabled) {
|
|
905
|
-
wasm.monsgamemodel_setVerboseTracking(this.__wbg_ptr, enabled);
|
|
906
|
-
}
|
|
907
|
-
/**
|
|
908
|
-
* @returns {(Location)[]}
|
|
909
|
-
*/
|
|
910
|
-
locations_with_content() {
|
|
911
|
-
try {
|
|
912
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
913
|
-
wasm.monsgamemodel_locations_with_content(retptr, this.__wbg_ptr);
|
|
914
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
915
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
916
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
917
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
918
|
-
return v1;
|
|
919
|
-
} finally {
|
|
920
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
/**
|
|
924
|
-
* @param {string} fen
|
|
925
|
-
* @returns {MonsGameModel | undefined}
|
|
926
|
-
*/
|
|
927
|
-
static fromFenForSimulation(fen) {
|
|
928
|
-
const ptr0 = passStringToWasm0(fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
929
|
-
const len0 = WASM_VECTOR_LEN;
|
|
930
|
-
const ret = wasm.monsgamemodel_fromFenForSimulation(ptr0, len0);
|
|
931
|
-
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* @returns {(VerboseTrackingEntityModel)[]}
|
|
935
|
-
*/
|
|
936
|
-
verbose_tracking_entities() {
|
|
937
|
-
try {
|
|
938
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
939
|
-
wasm.monsgamemodel_verbose_tracking_entities(retptr, this.__wbg_ptr);
|
|
940
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
941
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
942
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
943
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
944
|
-
return v1;
|
|
945
|
-
} finally {
|
|
946
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
/**
|
|
950
|
-
* @returns {Int32Array}
|
|
951
|
-
*/
|
|
952
|
-
inactive_player_items_counters() {
|
|
953
|
-
try {
|
|
954
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
955
|
-
wasm.monsgamemodel_inactive_player_items_counters(retptr, this.__wbg_ptr);
|
|
956
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
957
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
958
|
-
var v1 = getArrayI32FromWasm0(r0, r1).slice();
|
|
959
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
960
|
-
return v1;
|
|
961
|
-
} finally {
|
|
962
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* @returns {string}
|
|
967
|
-
*/
|
|
968
|
-
fen() {
|
|
969
|
-
let deferred1_0;
|
|
970
|
-
let deferred1_1;
|
|
971
|
-
try {
|
|
972
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
973
|
-
wasm.monsgamemodel_fen(retptr, this.__wbg_ptr);
|
|
974
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
975
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
976
|
-
deferred1_0 = r0;
|
|
977
|
-
deferred1_1 = r1;
|
|
978
|
-
return getStringFromWasm0(r0, r1);
|
|
979
|
-
} finally {
|
|
980
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
981
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
/**
|
|
985
|
-
* @param {GameVariant} variant
|
|
986
|
-
* @returns {MonsGameModel}
|
|
987
|
-
*/
|
|
988
|
-
static new(variant) {
|
|
989
|
-
const ret = wasm.monsgamemodel_new(variant);
|
|
990
|
-
return MonsGameModel.__wrap(ret);
|
|
991
|
-
}
|
|
992
|
-
/**
|
|
993
|
-
* @param {Location} at
|
|
994
|
-
* @returns {ItemModel | undefined}
|
|
995
|
-
*/
|
|
996
|
-
item(at) {
|
|
997
|
-
_assertClass(at, Location);
|
|
998
|
-
var ptr0 = at.__destroy_into_raw();
|
|
999
|
-
const ret = wasm.monsgamemodel_item(this.__wbg_ptr, ptr0);
|
|
1000
|
-
return ret === 0 ? undefined : ItemModel.__wrap(ret);
|
|
1001
|
-
}
|
|
1002
|
-
/**
|
|
1003
|
-
* @param {Location} at
|
|
1004
|
-
* @returns {SquareModel}
|
|
1005
|
-
*/
|
|
1006
|
-
square(at) {
|
|
1007
|
-
_assertClass(at, Location);
|
|
1008
|
-
var ptr0 = at.__destroy_into_raw();
|
|
1009
|
-
const ret = wasm.monsgamemodel_square(this.__wbg_ptr, ptr0);
|
|
1010
|
-
return SquareModel.__wrap(ret);
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* @returns {OutputModel}
|
|
1014
|
-
*/
|
|
1015
|
-
automove() {
|
|
1016
|
-
const ret = wasm.monsgamemodel_automove(this.__wbg_ptr);
|
|
1017
|
-
return OutputModel.__wrap(ret);
|
|
1018
|
-
}
|
|
1019
|
-
/**
|
|
1020
|
-
* @param {string} fen
|
|
1021
|
-
* @returns {MonsGameModel | undefined}
|
|
1022
|
-
*/
|
|
1023
|
-
static from_fen(fen) {
|
|
1024
|
-
const ptr0 = passStringToWasm0(fen, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1025
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1026
|
-
const ret = wasm.monsgamemodel_from_fen(ptr0, len0);
|
|
1027
|
-
return ret === 0 ? undefined : MonsGameModel.__wrap(ret);
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* @returns {OutputModel}
|
|
1031
|
-
*/
|
|
1032
|
-
takeback() {
|
|
1033
|
-
const ret = wasm.monsgamemodel_takeback(this.__wbg_ptr);
|
|
1034
|
-
return OutputModel.__wrap(ret);
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
module.exports.MonsGameModel = MonsGameModel;
|
|
1038
|
-
|
|
1039
|
-
const NextInputModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1040
|
-
? { register: () => {}, unregister: () => {} }
|
|
1041
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_nextinputmodel_free(ptr >>> 0));
|
|
1042
|
-
/**
|
|
1043
|
-
*/
|
|
1044
|
-
class NextInputModel {
|
|
1045
|
-
|
|
1046
|
-
static __wrap(ptr) {
|
|
1047
|
-
ptr = ptr >>> 0;
|
|
1048
|
-
const obj = Object.create(NextInputModel.prototype);
|
|
1049
|
-
obj.__wbg_ptr = ptr;
|
|
1050
|
-
NextInputModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1051
|
-
return obj;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
__destroy_into_raw() {
|
|
1055
|
-
const ptr = this.__wbg_ptr;
|
|
1056
|
-
this.__wbg_ptr = 0;
|
|
1057
|
-
NextInputModelFinalization.unregister(this);
|
|
1058
|
-
return ptr;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
free() {
|
|
1062
|
-
const ptr = this.__destroy_into_raw();
|
|
1063
|
-
wasm.__wbg_nextinputmodel_free(ptr);
|
|
1064
|
-
}
|
|
1065
|
-
/**
|
|
1066
|
-
* @returns {Location | undefined}
|
|
1067
|
-
*/
|
|
1068
|
-
get location() {
|
|
1069
|
-
const ret = wasm.__wbg_get_eventmodel_loc1(this.__wbg_ptr);
|
|
1070
|
-
return ret === 0 ? undefined : Location.__wrap(ret);
|
|
1071
|
-
}
|
|
1072
|
-
/**
|
|
1073
|
-
* @param {Location | undefined} [arg0]
|
|
1074
|
-
*/
|
|
1075
|
-
set location(arg0) {
|
|
1076
|
-
let ptr0 = 0;
|
|
1077
|
-
if (!isLikeNone(arg0)) {
|
|
1078
|
-
_assertClass(arg0, Location);
|
|
1079
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
1080
|
-
}
|
|
1081
|
-
wasm.__wbg_set_eventmodel_loc1(this.__wbg_ptr, ptr0);
|
|
1082
|
-
}
|
|
1083
|
-
/**
|
|
1084
|
-
* @returns {Modifier | undefined}
|
|
1085
|
-
*/
|
|
1086
|
-
get modifier() {
|
|
1087
|
-
const ret = wasm.__wbg_get_nextinputmodel_modifier(this.__wbg_ptr);
|
|
1088
|
-
return ret === 3 ? undefined : ret;
|
|
1089
|
-
}
|
|
1090
|
-
/**
|
|
1091
|
-
* @param {Modifier | undefined} [arg0]
|
|
1092
|
-
*/
|
|
1093
|
-
set modifier(arg0) {
|
|
1094
|
-
wasm.__wbg_set_nextinputmodel_modifier(this.__wbg_ptr, isLikeNone(arg0) ? 3 : arg0);
|
|
1095
|
-
}
|
|
1096
|
-
/**
|
|
1097
|
-
* @returns {NextInputKind}
|
|
1098
|
-
*/
|
|
1099
|
-
get kind() {
|
|
1100
|
-
const ret = wasm.__wbg_get_nextinputmodel_kind(this.__wbg_ptr);
|
|
1101
|
-
return ret;
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* @param {NextInputKind} arg0
|
|
1105
|
-
*/
|
|
1106
|
-
set kind(arg0) {
|
|
1107
|
-
wasm.__wbg_set_nextinputmodel_kind(this.__wbg_ptr, arg0);
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* @returns {ItemModel | undefined}
|
|
1111
|
-
*/
|
|
1112
|
-
get actor_mon_item() {
|
|
1113
|
-
const ret = wasm.__wbg_get_nextinputmodel_actor_mon_item(this.__wbg_ptr);
|
|
1114
|
-
return ret === 0 ? undefined : ItemModel.__wrap(ret);
|
|
1115
|
-
}
|
|
1116
|
-
/**
|
|
1117
|
-
* @param {ItemModel | undefined} [arg0]
|
|
1118
|
-
*/
|
|
1119
|
-
set actor_mon_item(arg0) {
|
|
1120
|
-
let ptr0 = 0;
|
|
1121
|
-
if (!isLikeNone(arg0)) {
|
|
1122
|
-
_assertClass(arg0, ItemModel);
|
|
1123
|
-
ptr0 = arg0.__destroy_into_raw();
|
|
1124
|
-
}
|
|
1125
|
-
wasm.__wbg_set_nextinputmodel_actor_mon_item(this.__wbg_ptr, ptr0);
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
module.exports.NextInputModel = NextInputModel;
|
|
1129
|
-
|
|
1130
|
-
const OutputModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1131
|
-
? { register: () => {}, unregister: () => {} }
|
|
1132
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_outputmodel_free(ptr >>> 0));
|
|
1133
|
-
/**
|
|
1134
|
-
*/
|
|
1135
|
-
class OutputModel {
|
|
1136
|
-
|
|
1137
|
-
static __wrap(ptr) {
|
|
1138
|
-
ptr = ptr >>> 0;
|
|
1139
|
-
const obj = Object.create(OutputModel.prototype);
|
|
1140
|
-
obj.__wbg_ptr = ptr;
|
|
1141
|
-
OutputModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1142
|
-
return obj;
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
__destroy_into_raw() {
|
|
1146
|
-
const ptr = this.__wbg_ptr;
|
|
1147
|
-
this.__wbg_ptr = 0;
|
|
1148
|
-
OutputModelFinalization.unregister(this);
|
|
1149
|
-
return ptr;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
free() {
|
|
1153
|
-
const ptr = this.__destroy_into_raw();
|
|
1154
|
-
wasm.__wbg_outputmodel_free(ptr);
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* @returns {(NextInputModel)[]}
|
|
1158
|
-
*/
|
|
1159
|
-
next_inputs() {
|
|
1160
|
-
try {
|
|
1161
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1162
|
-
wasm.outputmodel_next_inputs(retptr, this.__wbg_ptr);
|
|
1163
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1164
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1165
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1166
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1167
|
-
return v1;
|
|
1168
|
-
} finally {
|
|
1169
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
/**
|
|
1173
|
-
* @returns {(EventModel)[]}
|
|
1174
|
-
*/
|
|
1175
|
-
events() {
|
|
1176
|
-
try {
|
|
1177
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1178
|
-
wasm.outputmodel_events(retptr, this.__wbg_ptr);
|
|
1179
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1180
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1181
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1182
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1183
|
-
return v1;
|
|
1184
|
-
} finally {
|
|
1185
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
/**
|
|
1189
|
-
* @returns {string}
|
|
1190
|
-
*/
|
|
1191
|
-
input_fen() {
|
|
1192
|
-
let deferred1_0;
|
|
1193
|
-
let deferred1_1;
|
|
1194
|
-
try {
|
|
1195
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1196
|
-
wasm.outputmodel_input_fen(retptr, this.__wbg_ptr);
|
|
1197
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1198
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1199
|
-
deferred1_0 = r0;
|
|
1200
|
-
deferred1_1 = r1;
|
|
1201
|
-
return getStringFromWasm0(r0, r1);
|
|
1202
|
-
} finally {
|
|
1203
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1204
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
/**
|
|
1208
|
-
* @returns {(Location)[]}
|
|
1209
|
-
*/
|
|
1210
|
-
locations() {
|
|
1211
|
-
try {
|
|
1212
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1213
|
-
wasm.outputmodel_locations(retptr, this.__wbg_ptr);
|
|
1214
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1215
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1216
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1217
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1218
|
-
return v1;
|
|
1219
|
-
} finally {
|
|
1220
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
/**
|
|
1224
|
-
* @returns {OutputModelKind}
|
|
1225
|
-
*/
|
|
1226
|
-
get kind() {
|
|
1227
|
-
const ret = wasm.__wbg_get_outputmodel_kind(this.__wbg_ptr);
|
|
1228
|
-
return ret;
|
|
1229
|
-
}
|
|
1230
|
-
/**
|
|
1231
|
-
* @param {OutputModelKind} arg0
|
|
1232
|
-
*/
|
|
1233
|
-
set kind(arg0) {
|
|
1234
|
-
wasm.__wbg_set_outputmodel_kind(this.__wbg_ptr, arg0);
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
module.exports.OutputModel = OutputModel;
|
|
1238
|
-
|
|
1239
|
-
const SquareModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1240
|
-
? { register: () => {}, unregister: () => {} }
|
|
1241
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_squaremodel_free(ptr >>> 0));
|
|
1242
|
-
/**
|
|
1243
|
-
*/
|
|
1244
|
-
class SquareModel {
|
|
1245
|
-
|
|
1246
|
-
static __wrap(ptr) {
|
|
1247
|
-
ptr = ptr >>> 0;
|
|
1248
|
-
const obj = Object.create(SquareModel.prototype);
|
|
1249
|
-
obj.__wbg_ptr = ptr;
|
|
1250
|
-
SquareModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1251
|
-
return obj;
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
__destroy_into_raw() {
|
|
1255
|
-
const ptr = this.__wbg_ptr;
|
|
1256
|
-
this.__wbg_ptr = 0;
|
|
1257
|
-
SquareModelFinalization.unregister(this);
|
|
1258
|
-
return ptr;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
free() {
|
|
1262
|
-
const ptr = this.__destroy_into_raw();
|
|
1263
|
-
wasm.__wbg_squaremodel_free(ptr);
|
|
1264
|
-
}
|
|
1265
|
-
/**
|
|
1266
|
-
* @returns {SquareModelKind}
|
|
1267
|
-
*/
|
|
1268
|
-
get kind() {
|
|
1269
|
-
const ret = wasm.__wbg_get_squaremodel_kind(this.__wbg_ptr);
|
|
1270
|
-
return ret;
|
|
1271
|
-
}
|
|
1272
|
-
/**
|
|
1273
|
-
* @param {SquareModelKind} arg0
|
|
1274
|
-
*/
|
|
1275
|
-
set kind(arg0) {
|
|
1276
|
-
wasm.__wbg_set_squaremodel_kind(this.__wbg_ptr, arg0);
|
|
1277
|
-
}
|
|
1278
|
-
/**
|
|
1279
|
-
* @returns {Color | undefined}
|
|
1280
|
-
*/
|
|
1281
|
-
get color() {
|
|
1282
|
-
const ret = wasm.__wbg_get_squaremodel_color(this.__wbg_ptr);
|
|
1283
|
-
return ret === 2 ? undefined : ret;
|
|
1284
|
-
}
|
|
1285
|
-
/**
|
|
1286
|
-
* @param {Color | undefined} [arg0]
|
|
1287
|
-
*/
|
|
1288
|
-
set color(arg0) {
|
|
1289
|
-
wasm.__wbg_set_squaremodel_color(this.__wbg_ptr, isLikeNone(arg0) ? 2 : arg0);
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* @returns {MonKind | undefined}
|
|
1293
|
-
*/
|
|
1294
|
-
get mon_kind() {
|
|
1295
|
-
const ret = wasm.__wbg_get_squaremodel_mon_kind(this.__wbg_ptr);
|
|
1296
|
-
return ret === 5 ? undefined : ret;
|
|
1297
|
-
}
|
|
1298
|
-
/**
|
|
1299
|
-
* @param {MonKind | undefined} [arg0]
|
|
1300
|
-
*/
|
|
1301
|
-
set mon_kind(arg0) {
|
|
1302
|
-
wasm.__wbg_set_squaremodel_mon_kind(this.__wbg_ptr, isLikeNone(arg0) ? 5 : arg0);
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
module.exports.SquareModel = SquareModel;
|
|
1306
|
-
|
|
1307
|
-
const VerboseTrackingEntityModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1308
|
-
? { register: () => {}, unregister: () => {} }
|
|
1309
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_verbosetrackingentitymodel_free(ptr >>> 0));
|
|
1310
|
-
/**
|
|
1311
|
-
*/
|
|
1312
|
-
class VerboseTrackingEntityModel {
|
|
1313
|
-
|
|
1314
|
-
static __wrap(ptr) {
|
|
1315
|
-
ptr = ptr >>> 0;
|
|
1316
|
-
const obj = Object.create(VerboseTrackingEntityModel.prototype);
|
|
1317
|
-
obj.__wbg_ptr = ptr;
|
|
1318
|
-
VerboseTrackingEntityModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1319
|
-
return obj;
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
__destroy_into_raw() {
|
|
1323
|
-
const ptr = this.__wbg_ptr;
|
|
1324
|
-
this.__wbg_ptr = 0;
|
|
1325
|
-
VerboseTrackingEntityModelFinalization.unregister(this);
|
|
1326
|
-
return ptr;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
free() {
|
|
1330
|
-
const ptr = this.__destroy_into_raw();
|
|
1331
|
-
wasm.__wbg_verbosetrackingentitymodel_free(ptr);
|
|
1332
|
-
}
|
|
1333
|
-
/**
|
|
1334
|
-
* @returns {string}
|
|
1335
|
-
*/
|
|
1336
|
-
events_fen() {
|
|
1337
|
-
let deferred1_0;
|
|
1338
|
-
let deferred1_1;
|
|
1339
|
-
try {
|
|
1340
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1341
|
-
wasm.verbosetrackingentitymodel_events_fen(retptr, this.__wbg_ptr);
|
|
1342
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1343
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1344
|
-
deferred1_0 = r0;
|
|
1345
|
-
deferred1_1 = r1;
|
|
1346
|
-
return getStringFromWasm0(r0, r1);
|
|
1347
|
-
} finally {
|
|
1348
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1349
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
/**
|
|
1353
|
-
* @returns {string}
|
|
1354
|
-
*/
|
|
1355
|
-
fen() {
|
|
1356
|
-
let deferred1_0;
|
|
1357
|
-
let deferred1_1;
|
|
1358
|
-
try {
|
|
1359
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1360
|
-
wasm.verbosetrackingentitymodel_fen(retptr, this.__wbg_ptr);
|
|
1361
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1362
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1363
|
-
deferred1_0 = r0;
|
|
1364
|
-
deferred1_1 = r1;
|
|
1365
|
-
return getStringFromWasm0(r0, r1);
|
|
1366
|
-
} finally {
|
|
1367
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1368
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
/**
|
|
1372
|
-
* @returns {Color}
|
|
1373
|
-
*/
|
|
1374
|
-
color() {
|
|
1375
|
-
const ret = wasm.verbosetrackingentitymodel_color(this.__wbg_ptr);
|
|
1376
|
-
return ret;
|
|
1377
|
-
}
|
|
1378
|
-
/**
|
|
1379
|
-
* @returns {(EventModel)[]}
|
|
1380
|
-
*/
|
|
1381
|
-
events() {
|
|
1382
|
-
try {
|
|
1383
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1384
|
-
wasm.verbosetrackingentitymodel_events(retptr, this.__wbg_ptr);
|
|
1385
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1386
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1387
|
-
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1388
|
-
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1389
|
-
return v1;
|
|
1390
|
-
} finally {
|
|
1391
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
module.exports.VerboseTrackingEntityModel = VerboseTrackingEntityModel;
|
|
1396
|
-
|
|
1397
|
-
module.exports.__wbg_location_unwrap = function(arg0) {
|
|
1398
|
-
const ret = Location.__unwrap(takeObject(arg0));
|
|
1399
|
-
return ret;
|
|
1400
|
-
};
|
|
1401
|
-
|
|
1402
|
-
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1403
|
-
takeObject(arg0);
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
module.exports.__wbg_eventmodel_new = function(arg0) {
|
|
1407
|
-
const ret = EventModel.__wrap(arg0);
|
|
1408
|
-
return addHeapObject(ret);
|
|
1409
|
-
};
|
|
1410
|
-
|
|
1411
|
-
module.exports.__wbg_nextinputmodel_new = function(arg0) {
|
|
1412
|
-
const ret = NextInputModel.__wrap(arg0);
|
|
1413
|
-
return addHeapObject(ret);
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1417
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1418
|
-
return addHeapObject(ret);
|
|
1419
|
-
};
|
|
1420
|
-
|
|
1421
|
-
module.exports.__wbg_verbosetrackingentitymodel_new = function(arg0) {
|
|
1422
|
-
const ret = VerboseTrackingEntityModel.__wrap(arg0);
|
|
1423
|
-
return addHeapObject(ret);
|
|
1424
|
-
};
|
|
1425
|
-
|
|
1426
|
-
module.exports.__wbg_location_new = function(arg0) {
|
|
1427
|
-
const ret = Location.__wrap(arg0);
|
|
1428
|
-
return addHeapObject(ret);
|
|
1429
|
-
};
|
|
1430
|
-
|
|
1431
|
-
module.exports.__wbindgen_is_object = function(arg0) {
|
|
1432
|
-
const val = getObject(arg0);
|
|
1433
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
1434
|
-
return ret;
|
|
1435
|
-
};
|
|
1436
|
-
|
|
1437
|
-
module.exports.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
1438
|
-
const ret = getObject(arg0).crypto;
|
|
1439
|
-
return addHeapObject(ret);
|
|
1440
|
-
};
|
|
1441
|
-
|
|
1442
|
-
module.exports.__wbg_process_4a72847cc503995b = function(arg0) {
|
|
1443
|
-
const ret = getObject(arg0).process;
|
|
1444
|
-
return addHeapObject(ret);
|
|
1445
|
-
};
|
|
1446
|
-
|
|
1447
|
-
module.exports.__wbg_versions_f686565e586dd935 = function(arg0) {
|
|
1448
|
-
const ret = getObject(arg0).versions;
|
|
1449
|
-
return addHeapObject(ret);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const api = require("./mons-rust-internal.cjs");
|
|
4
|
+
|
|
5
|
+
exports.AvailableMoveKind = api.AvailableMoveKind;
|
|
6
|
+
exports.Color = api.Color;
|
|
7
|
+
exports.Consumable = api.Consumable;
|
|
8
|
+
exports.EventModel = api.EventModel;
|
|
9
|
+
exports.EventModelKind = api.EventModelKind;
|
|
10
|
+
exports.GameVariant = api.GameVariant;
|
|
11
|
+
exports.ItemModel = api.ItemModel;
|
|
12
|
+
exports.ItemModelKind = api.ItemModelKind;
|
|
13
|
+
exports.Location = api.Location;
|
|
14
|
+
exports.ManaKind = api.ManaKind;
|
|
15
|
+
exports.ManaModel = api.ManaModel;
|
|
16
|
+
exports.Modifier = api.Modifier;
|
|
17
|
+
exports.Mon = api.Mon;
|
|
18
|
+
exports.MonKind = api.MonKind;
|
|
19
|
+
exports.MonsGameModel = api.MonsGameModel;
|
|
20
|
+
exports.NextInputKind = api.NextInputKind;
|
|
21
|
+
exports.NextInputModel = api.NextInputModel;
|
|
22
|
+
exports.OutputModel = api.OutputModel;
|
|
23
|
+
exports.OutputModelKind = api.OutputModelKind;
|
|
24
|
+
exports.SquareModel = api.SquareModel;
|
|
25
|
+
exports.SquareModelKind = api.SquareModelKind;
|
|
26
|
+
exports.VerboseTrackingEntityModel = api.VerboseTrackingEntityModel;
|
|
27
|
+
exports.winner = function (
|
|
28
|
+
fen_w,
|
|
29
|
+
fen_b,
|
|
30
|
+
flat_moves_string_w,
|
|
31
|
+
flat_moves_string_b,
|
|
32
|
+
) {
|
|
33
|
+
return api.winner(fen_w, fen_b, flat_moves_string_w, flat_moves_string_b);
|
|
1450
34
|
};
|
|
1451
|
-
|
|
1452
|
-
module.exports.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
|
1453
|
-
const ret = getObject(arg0).node;
|
|
1454
|
-
return addHeapObject(ret);
|
|
1455
|
-
};
|
|
1456
|
-
|
|
1457
|
-
module.exports.__wbindgen_is_string = function(arg0) {
|
|
1458
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
1459
|
-
return ret;
|
|
1460
|
-
};
|
|
1461
|
-
|
|
1462
|
-
module.exports.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
|
1463
|
-
const ret = module.require;
|
|
1464
|
-
return addHeapObject(ret);
|
|
1465
|
-
}, arguments) };
|
|
1466
|
-
|
|
1467
|
-
module.exports.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
|
1468
|
-
const ret = getObject(arg0).msCrypto;
|
|
1469
|
-
return addHeapObject(ret);
|
|
1470
|
-
};
|
|
1471
|
-
|
|
1472
|
-
module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
|
1473
|
-
getObject(arg0).getRandomValues(getObject(arg1));
|
|
1474
|
-
}, arguments) };
|
|
1475
|
-
|
|
1476
|
-
module.exports.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
|
1477
|
-
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
1478
|
-
}, arguments) };
|
|
1479
|
-
|
|
1480
|
-
module.exports.__wbindgen_is_function = function(arg0) {
|
|
1481
|
-
const ret = typeof(getObject(arg0)) === 'function';
|
|
1482
|
-
return ret;
|
|
1483
|
-
};
|
|
1484
|
-
|
|
1485
|
-
module.exports.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
|
1486
|
-
const ret = self.self;
|
|
1487
|
-
return addHeapObject(ret);
|
|
1488
|
-
}, arguments) };
|
|
1489
|
-
|
|
1490
|
-
module.exports.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
|
1491
|
-
const ret = window.window;
|
|
1492
|
-
return addHeapObject(ret);
|
|
1493
|
-
}, arguments) };
|
|
1494
|
-
|
|
1495
|
-
module.exports.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
|
1496
|
-
const ret = globalThis.globalThis;
|
|
1497
|
-
return addHeapObject(ret);
|
|
1498
|
-
}, arguments) };
|
|
1499
|
-
|
|
1500
|
-
module.exports.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
|
1501
|
-
const ret = global.global;
|
|
1502
|
-
return addHeapObject(ret);
|
|
1503
|
-
}, arguments) };
|
|
1504
|
-
|
|
1505
|
-
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
1506
|
-
const ret = getObject(arg0) === undefined;
|
|
1507
|
-
return ret;
|
|
1508
|
-
};
|
|
1509
|
-
|
|
1510
|
-
module.exports.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
|
1511
|
-
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1512
|
-
return addHeapObject(ret);
|
|
1513
|
-
};
|
|
1514
|
-
|
|
1515
|
-
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
1516
|
-
const ret = getObject(arg0);
|
|
1517
|
-
return addHeapObject(ret);
|
|
1518
|
-
};
|
|
1519
|
-
|
|
1520
|
-
module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
1521
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
1522
|
-
return addHeapObject(ret);
|
|
1523
|
-
};
|
|
1524
|
-
|
|
1525
|
-
module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
|
1526
|
-
const ret = getObject(arg0).buffer;
|
|
1527
|
-
return addHeapObject(ret);
|
|
1528
|
-
};
|
|
1529
|
-
|
|
1530
|
-
module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
|
1531
|
-
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
1532
|
-
return addHeapObject(ret);
|
|
1533
|
-
};
|
|
1534
|
-
|
|
1535
|
-
module.exports.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
1536
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
1537
|
-
return addHeapObject(ret);
|
|
1538
|
-
};
|
|
1539
|
-
|
|
1540
|
-
module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
1541
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1542
|
-
};
|
|
1543
|
-
|
|
1544
|
-
module.exports.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
|
1545
|
-
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1546
|
-
return addHeapObject(ret);
|
|
1547
|
-
};
|
|
1548
|
-
|
|
1549
|
-
module.exports.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
|
1550
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
1551
|
-
return addHeapObject(ret);
|
|
1552
|
-
}, arguments) };
|
|
1553
|
-
|
|
1554
|
-
module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1555
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1556
|
-
return addHeapObject(ret);
|
|
1557
|
-
}, arguments) };
|
|
1558
|
-
|
|
1559
|
-
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1560
|
-
const obj = getObject(arg1);
|
|
1561
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1562
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1563
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1564
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
1565
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1566
|
-
};
|
|
1567
|
-
|
|
1568
|
-
module.exports.__wbindgen_memory = function() {
|
|
1569
|
-
const ret = wasm.memory;
|
|
1570
|
-
return addHeapObject(ret);
|
|
1571
|
-
};
|
|
1572
|
-
|
|
1573
|
-
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
1574
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1575
|
-
};
|
|
1576
|
-
|
|
1577
|
-
const path = require('path').join(__dirname, 'mons-rust_bg.wasm');
|
|
1578
|
-
const bytes = require('fs').readFileSync(path);
|
|
1579
|
-
|
|
1580
|
-
const wasmModule = new WebAssembly.Module(bytes);
|
|
1581
|
-
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
1582
|
-
wasm = wasmInstance.exports;
|
|
1583
|
-
module.exports.__wasm = wasm;
|
|
1584
|
-
|