mons-web 0.1.13 → 0.1.15

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 CHANGED
@@ -10,6 +10,37 @@
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
+ }
33
+ /**
34
+ */
35
+ export enum MonKind {
36
+ Demon = 0,
37
+ Drainer = 1,
38
+ Angel = 2,
39
+ Spirit = 3,
40
+ Mystic = 4,
41
+ }
42
+ /**
43
+ */
13
44
  export enum Modifier {
14
45
  SelectPotion = 0,
15
46
  SelectBomb = 1,
@@ -30,31 +61,24 @@ export enum NextInputKind {
30
61
  }
31
62
  /**
32
63
  */
33
- export enum EventModelKind {
34
- MonMove = 0,
35
- ManaMove = 1,
36
- ManaScored = 2,
37
- MysticAction = 3,
38
- DemonAction = 4,
39
- DemonAdditionalStep = 5,
40
- SpiritTargetMove = 6,
41
- PickupBomb = 7,
42
- PickupPotion = 8,
43
- PickupMana = 9,
44
- MonFainted = 10,
45
- ManaDropped = 11,
46
- SupermanaBackToBase = 12,
47
- BombAttack = 13,
48
- MonAwake = 14,
49
- BombExplosion = 15,
50
- NextTurn = 16,
51
- GameOver = 17,
64
+ export enum Consumable {
65
+ Potion = 0,
66
+ Bomb = 1,
67
+ BombOrPotion = 2,
52
68
  }
53
69
  /**
54
70
  */
55
- export enum ManaKind {
56
- Regular = 0,
57
- Supermana = 1,
71
+ export enum OutputModelKind {
72
+ InvalidInput = 0,
73
+ LocationsToStartFrom = 1,
74
+ NextInputOptions = 2,
75
+ Events = 3,
76
+ }
77
+ /**
78
+ */
79
+ export enum Color {
80
+ White = 0,
81
+ Black = 1,
58
82
  }
59
83
  /**
60
84
  */
@@ -77,16 +101,9 @@ export enum ItemModelKind {
77
101
  }
78
102
  /**
79
103
  */
80
- export enum Color {
81
- White = 0,
82
- Black = 1,
83
- }
84
- /**
85
- */
86
- export enum Consumable {
87
- Potion = 0,
88
- Bomb = 1,
89
- BombOrPotion = 2,
104
+ export enum ManaKind {
105
+ Regular = 0,
106
+ Supermana = 1,
90
107
  }
91
108
  /**
92
109
  */
@@ -98,23 +115,6 @@ export enum AvailableMoveKind {
98
115
  }
99
116
  /**
100
117
  */
101
- export enum OutputModelKind {
102
- InvalidInput = 0,
103
- LocationsToStartFrom = 1,
104
- NextInputOptions = 2,
105
- Events = 3,
106
- }
107
- /**
108
- */
109
- export enum MonKind {
110
- Demon = 0,
111
- Drainer = 1,
112
- Angel = 2,
113
- Spirit = 3,
114
- Mystic = 4,
115
- }
116
- /**
117
- */
118
118
  export class EventModel {
119
119
  free(): void;
120
120
  }
@@ -186,6 +186,10 @@ export class Mon {
186
186
  export class MonsGameModel {
187
187
  free(): void;
188
188
  /**
189
+ * @returns {MonsGameModel}
190
+ */
191
+ static new(): MonsGameModel;
192
+ /**
189
193
  * @param {string} fen
190
194
  * @returns {MonsGameModel | undefined}
191
195
  */
@@ -297,6 +301,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
297
301
  export interface InitOutput {
298
302
  readonly memory: WebAssembly.Memory;
299
303
  readonly __wbg_monsgamemodel_free: (a: number) => void;
304
+ readonly monsgamemodel_new: () => number;
300
305
  readonly monsgamemodel_from_fen: (a: number, b: number) => number;
301
306
  readonly monsgamemodel_fen: (a: number, b: number) => void;
302
307
  readonly monsgamemodel_process_input: (a: number, b: number, c: number, d: number) => number;
package/mons_rust.js CHANGED
@@ -191,37 +191,37 @@ export function winner(fen_w, fen_b, flat_moves_string_w, flat_moves_string_b) {
191
191
 
192
192
  /**
193
193
  */
194
- export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
194
+ export const EventModelKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",ManaScored:2,"2":"ManaScored",MysticAction:3,"3":"MysticAction",DemonAction:4,"4":"DemonAction",DemonAdditionalStep:5,"5":"DemonAdditionalStep",SpiritTargetMove:6,"6":"SpiritTargetMove",PickupBomb:7,"7":"PickupBomb",PickupPotion:8,"8":"PickupPotion",PickupMana:9,"9":"PickupMana",MonFainted:10,"10":"MonFainted",ManaDropped:11,"11":"ManaDropped",SupermanaBackToBase:12,"12":"SupermanaBackToBase",BombAttack:13,"13":"BombAttack",MonAwake:14,"14":"MonAwake",BombExplosion:15,"15":"BombExplosion",NextTurn:16,"16":"NextTurn",GameOver:17,"17":"GameOver", });
195
195
  /**
196
196
  */
197
- export const NextInputKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",MysticAction:2,"2":"MysticAction",DemonAction:3,"3":"DemonAction",DemonAdditionalStep:4,"4":"DemonAdditionalStep",SpiritTargetCapture:5,"5":"SpiritTargetCapture",SpiritTargetMove:6,"6":"SpiritTargetMove",SelectConsumable:7,"7":"SelectConsumable",BombAttack:8,"8":"BombAttack", });
197
+ export const MonKind = Object.freeze({ Demon:0,"0":"Demon",Drainer:1,"1":"Drainer",Angel:2,"2":"Angel",Spirit:3,"3":"Spirit",Mystic:4,"4":"Mystic", });
198
198
  /**
199
199
  */
200
- export const EventModelKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",ManaScored:2,"2":"ManaScored",MysticAction:3,"3":"MysticAction",DemonAction:4,"4":"DemonAction",DemonAdditionalStep:5,"5":"DemonAdditionalStep",SpiritTargetMove:6,"6":"SpiritTargetMove",PickupBomb:7,"7":"PickupBomb",PickupPotion:8,"8":"PickupPotion",PickupMana:9,"9":"PickupMana",MonFainted:10,"10":"MonFainted",ManaDropped:11,"11":"ManaDropped",SupermanaBackToBase:12,"12":"SupermanaBackToBase",BombAttack:13,"13":"BombAttack",MonAwake:14,"14":"MonAwake",BombExplosion:15,"15":"BombExplosion",NextTurn:16,"16":"NextTurn",GameOver:17,"17":"GameOver", });
200
+ export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
201
201
  /**
202
202
  */
203
- export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
203
+ export const NextInputKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",MysticAction:2,"2":"MysticAction",DemonAction:3,"3":"DemonAction",DemonAdditionalStep:4,"4":"DemonAdditionalStep",SpiritTargetCapture:5,"5":"SpiritTargetCapture",SpiritTargetMove:6,"6":"SpiritTargetMove",SelectConsumable:7,"7":"SelectConsumable",BombAttack:8,"8":"BombAttack", });
204
204
  /**
205
205
  */
206
- export const SquareModelKind = Object.freeze({ Regular:0,"0":"Regular",ConsumableBase:1,"1":"ConsumableBase",SupermanaBase:2,"2":"SupermanaBase",ManaBase:3,"3":"ManaBase",ManaPool:4,"4":"ManaPool",MonBase:5,"5":"MonBase", });
206
+ export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
207
207
  /**
208
208
  */
209
- export const ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
209
+ export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
210
210
  /**
211
211
  */
212
212
  export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
213
213
  /**
214
214
  */
215
- export const Consumable = Object.freeze({ Potion:0,"0":"Potion",Bomb:1,"1":"Bomb",BombOrPotion:2,"2":"BombOrPotion", });
215
+ export const SquareModelKind = Object.freeze({ Regular:0,"0":"Regular",ConsumableBase:1,"1":"ConsumableBase",SupermanaBase:2,"2":"SupermanaBase",ManaBase:3,"3":"ManaBase",ManaPool:4,"4":"ManaPool",MonBase:5,"5":"MonBase", });
216
216
  /**
217
217
  */
218
- export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
218
+ export const ItemModelKind = Object.freeze({ Mon:0,"0":"Mon",Mana:1,"1":"Mana",MonWithMana:2,"2":"MonWithMana",MonWithConsumable:3,"3":"MonWithConsumable",Consumable:4,"4":"Consumable", });
219
219
  /**
220
220
  */
221
- export const OutputModelKind = Object.freeze({ InvalidInput:0,"0":"InvalidInput",LocationsToStartFrom:1,"1":"LocationsToStartFrom",NextInputOptions:2,"2":"NextInputOptions",Events:3,"3":"Events", });
221
+ export const ManaKind = Object.freeze({ Regular:0,"0":"Regular",Supermana:1,"1":"Supermana", });
222
222
  /**
223
223
  */
224
- export const MonKind = Object.freeze({ Demon:0,"0":"Demon",Drainer:1,"1":"Drainer",Angel:2,"2":"Angel",Spirit:3,"3":"Spirit",Mystic:4,"4":"Mystic", });
224
+ export const AvailableMoveKind = Object.freeze({ MonMove:0,"0":"MonMove",ManaMove:1,"1":"ManaMove",Action:2,"2":"Action",Potion:3,"3":"Potion", });
225
225
 
226
226
  const EventModelFinalization = (typeof FinalizationRegistry === 'undefined')
227
227
  ? { register: () => {}, unregister: () => {} }
@@ -516,6 +516,13 @@ export class MonsGameModel {
516
516
  wasm.__wbg_monsgamemodel_free(ptr);
517
517
  }
518
518
  /**
519
+ * @returns {MonsGameModel}
520
+ */
521
+ static new() {
522
+ const ret = wasm.monsgamemodel_new();
523
+ return MonsGameModel.__wrap(ret);
524
+ }
525
+ /**
519
526
  * @param {string} fen
520
527
  * @returns {MonsGameModel | undefined}
521
528
  */
@@ -917,14 +924,14 @@ async function __wbg_load(module, imports) {
917
924
  function __wbg_get_imports() {
918
925
  const imports = {};
919
926
  imports.wbg = {};
920
- imports.wbg.__wbg_eventmodel_new = function(arg0) {
921
- const ret = EventModel.__wrap(arg0);
922
- return addHeapObject(ret);
923
- };
924
927
  imports.wbg.__wbg_nextinputmodel_new = function(arg0) {
925
928
  const ret = NextInputModel.__wrap(arg0);
926
929
  return addHeapObject(ret);
927
930
  };
931
+ imports.wbg.__wbg_eventmodel_new = function(arg0) {
932
+ const ret = EventModel.__wrap(arg0);
933
+ return addHeapObject(ret);
934
+ };
928
935
  imports.wbg.__wbg_location_new = function(arg0) {
929
936
  const ret = Location.__wrap(arg0);
930
937
  return addHeapObject(ret);
package/mons_rust_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mons-web",
3
3
  "description": "super metal mons",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "license": "CC0-1.0",
6
6
  "files": [
7
7
  "mons_rust_bg.wasm",