qpremake 1.5.2 → 1.5.3

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 CHANGED
@@ -1,9 +1,54 @@
1
- # qpRemake
2
-
3
- This is a card processing system for the game "Quantum Protocol" remade in native Typescript.
4
- Quantum Protocol and Jkong reserves all rights to the game and all related assets.
5
-
6
- ## Installation
1
+ # qpRemake
2
+
3
+ This is a card effect processing system for the game "Quantum Protocol" remade in native Typescript.
4
+
5
+ > Quantum Protocol and Jkong reserves all rights to the game and all related assets.
6
+
7
+ ## Table of contents
8
+
9
+ - [qpRemake](#qpremake)
10
+ - [Table of contents](#table-of-contents)
11
+ - [Installation](#installation)
12
+ - [Usage](#usage)
13
+ - [Basic usage](#basic-usage)
14
+ - [What the imported objects do](#what-the-imported-objects-do)
15
+ - [**queenSystem**](#queensystem)
16
+ - [**queenSystemComponents**](#queensystemcomponents)
17
+ - [**gameComponent**:](#gamecomponent)
18
+ - [**systemComponent**](#systemcomponent)
19
+ - [**queenSystemUtils**](#queensystemutils)
20
+ - [Advanced usage:](#advanced-usage)
21
+ - [Making your own renderer](#making-your-own-renderer)
22
+ - [Saving and loading game state:](#saving-and-loading-game-state)
23
+ - [Display texts](#display-texts)
24
+ - [Handling inputs](#handling-inputs)
25
+ - [Modding](#modding)
26
+ - [What is a mod?](#what-is-a-mod)
27
+ - [How mods are run](#how-mods-are-run)
28
+ - [How to make a mod](#how-to-make-a-mod)
29
+ - [Adding a mod](#adding-a-mod)
30
+ - [Example: Adding a custom effect](#example-adding-a-custom-effect)
31
+ - [Project contribution](#project-contribution)
32
+ - [Current progress:](#current-progress)
33
+ - [How to get and develop the project](#how-to-get-and-develop-the-project)
34
+ - [Clone the project:](#clone-the-project)
35
+ - [Run the project](#run-the-project)
36
+ - [Game components](#game-components)
37
+ - [Main gameplay loop](#main-gameplay-loop)
38
+ - [Project structure](#project-structure)
39
+ - [Contribution workflow guide](#contribution-workflow-guide)
40
+ - [Make effects](#make-effects)
41
+ - [Add more actions (if needed)](#add-more-actions-if-needed)
42
+ - [Update effect registry](#update-effect-registry)
43
+ - [Update card registry](#update-card-registry)
44
+ - [Update defaultSetting](#update-defaultsetting)
45
+ - [Running tests](#running-tests)
46
+ - [Make renderers](#make-renderers)
47
+ - [Improving the text parser](#improving-the-text-parser)
48
+
49
+
50
+
51
+ # Installation
7
52
 
8
53
  The system is available via npm.
9
54
 
@@ -14,8 +59,9 @@ npm i qpremake
14
59
  And then can be imported via
15
60
 
16
61
  ```ts
62
+ // ts
17
63
  import {
18
- queenSystem,
64
+ queenSystem as s,
19
65
  queenSystemComponents,
20
66
  queenSystemUtils
21
67
  } from "qpremake"
@@ -24,6 +70,7 @@ import {
24
70
  or
25
71
 
26
72
  ```js
73
+ // js
27
74
  const {
28
75
  queenSystem,
29
76
  queenSystemComponents,
@@ -34,15 +81,21 @@ const {
34
81
  There is also a default import for just the ```queenSystem```
35
82
 
36
83
  ```ts
84
+ // ts
37
85
  import queenSystem from "qpRemake"
38
86
  ```
39
87
 
40
88
  or
41
89
 
42
90
  ```js
91
+ // js
43
92
  const queenSystem = require("qpRemake")
44
93
  ```
45
94
 
95
+ # Usage
96
+
97
+ This section is dedicated to thos who wish to use the system and render out a game, rather than modding stuff.
98
+
46
99
  ## Basic usage
47
100
 
48
101
  This here is just a calculator for card effects. To have it renders out something visible, (like text or an HTML page), you have to hook it up to a ```Renderer```.
@@ -53,13 +106,15 @@ This code binds a renderer of your choice to the system for rendering. More info
53
106
  import {queenSystem, queenSystemComponents} from "qpRemake"
54
107
 
55
108
  const { operatorRegistry } = queenSystemComponents.registry
109
+ const sampleRenderer = queenSystemComponents.systemComponent.sampleRenderer
110
+ const defaultSetting = { queenSystemComponents }
56
111
 
57
112
  let setting = new defaultSetting()
58
113
  let renderer = new YourRendererHere()
59
114
  // Your renderer shoudld be here
60
115
  // What interface it follows is in the later sections.
61
116
 
62
- let s = new queenSystem(setting, renderer)
117
+ let s = new queenSystem(setting, sampleRenderer)
63
118
  renderer.bind(s)
64
119
  s.addPlayers("player", operatorRegistry.o_esper)
65
120
  s.addPlayers("enemy", operatorRegistry.o_null)
@@ -70,7 +125,7 @@ s.start();
70
125
 
71
126
  ## What the imported objects do
72
127
 
73
- ### queenSystem
128
+ ### **queenSystem**
74
129
 
75
130
  The queenSystem is a class that handles card effect calculations.
76
131
 
@@ -95,191 +150,289 @@ Here is a cheatsheet of what this class does from the perspective of a renderer:
95
150
  3. ```addDeck``` : for adding decks
96
151
  4. ```start``` : start the game
97
152
 
98
- ### queenSystemComponents
153
+ ### **queenSystemComponents**
99
154
 
100
155
  Various classes used in the processing of card effects.
101
156
 
102
157
  Use from the perspective of a modder who wants to add more cards / effects.
103
158
  Outside of this, one can read the data from the various registries (either enum or const key -> data pair).
104
159
 
105
- The structure of this object is as follows:
160
+ For a cheat sheet, here are the properties of systemComponent:
161
+
162
+ 1. ```gameComponent``` : holds various game component classes.
163
+ 2. ```systemComponent``` : holds various services to operate on data
164
+ 3. ```displayComponent``` : holds display parsed segements
165
+ 4. ```registry``` : holds data
166
+ 5. ```defaultSetting``` : holds the default setting
167
+ 6. ```mod``` : holds what format mods must follows
168
+
169
+ #### **gameComponent**:
170
+
171
+ Holds various game component classes like ```Card, Effect, ...```.
172
+
173
+ The complete list is:
174
+
175
+ *Class entries*
176
+ 1. ```Card```
177
+ 2. ```Effect```
178
+ 3. ```Zone_grid``` and ```Zone_stack``` : Default zone implementation
179
+ 4. ```Action```
180
+
181
+ *Objects with classes inside*
182
+
183
+ 5. ```EffectType``` :Various effect types
184
+ 6. ```EffectSubType``` : Various effect subtypes
185
+ 7. ```Zone``` : Various default zones
186
+ 8. ```Serialized``` : Serialized components, for saving and loading
187
+ 9. ```Localized``` : Localized components, passed to the renderer
188
+
189
+ #### **systemComponent**
190
+
191
+ Hold various services outside of gameplay intepretations.
192
+
193
+ The complete list is:
194
+
195
+ 1. ```EffectTextParser``` : parses effect text
196
+ 2. ```Localizer``` : localzied game components
197
+ 3. ```ActionGenerator``` : generates actions
198
+ 4. ```InputRequester``` : generates input requests
199
+ 5. ```Renderer``` : an abstract class to how a renderer linked to the system shoudll be formatted.
200
+ 6. ```SampleRenderer``` : an example renderer
201
+
202
+ ### **queenSystemUtils**
203
+
204
+ Holds various utilities functions like rng or ID generation.
205
+
206
+ This object is also available as a global object in ```Utils```.
207
+
208
+ ## Advanced usage:
209
+
210
+ ### Making your own renderer
211
+
212
+ A renderer's job is to ..well render stuff.
213
+
214
+ The work flow of a renderer in **qpRemake** is to receive API like requests during the turn, renders it, then return control to the system to process more stuff.
215
+
216
+ The base abstract class / interface can be found in
106
217
 
107
218
  ```ts
108
- const queenSystemComponents = {
109
- "gameComponent" : {
110
- //Action class, stores what to do (move card, delete, execute, etc)
111
- Action,
112
-
113
- //Card class, represents a card, all cards extends from this
114
- Card,
115
-
116
- //Effect class, cards contain effects, all effects extends from this
117
- Effect,
118
-
119
- //Two premade form of a zone class, mainly differ in how to store and interact with stored cards
120
- Zone_grid, Zone_stack,
121
- "Zone" : {
122
-
123
- //Zone class, mainly just here for instanceof, use the above Zone_grid and Zone_stack instead
124
- "ParentClass" : Zone,
125
-
126
- //Below this are various premade zones
127
- //To add your own, extend from one of Zone_grid or Zone_stack
128
- //and implement zone methods to move cards and interupt events
129
-
130
- //Zones initiates with a data structure
131
- //to define capacity, shape, etc
132
- //See zoneDataRegistry
133
-
134
- Ability,
135
- Deck,
136
- Drop,
137
- Field,
138
- Grave,
139
- Hand,
140
- Storage,
141
- System,
142
- Void
143
- },
144
- "EffectSubType" : {
145
-
146
- // Effects can have subtypes
147
- // subtypes of an effect modifies an Effect's attribute
148
- // and / or modifies the response
149
- "ParentClass" : EffectSubtype,
150
-
151
- //Below are various premade subtypes
152
-
153
- Chained,
154
- Delayed,
155
- FieldLock,
156
- GraveLock,
157
- HandOrFieldLock,
158
- HardUnique,
159
- Instant,
160
- Once,
161
- Unique
162
- },
163
- "EffectType" : {
164
-
165
- // Effects can also have a type
166
- "ParentClass" : EffectType,
167
- InitEffect,
168
- LockEffect,
169
- ManualEffect,
170
- PassiveEffect,
171
- TriggerEffect
172
- },
173
- "Serialized" : {
174
-
175
- // The serialized version of game components
176
- // remove circular references and should be save to JSON stringify
177
- // and save
178
- SerializedCard,
179
- Serialized_effect,
180
- SerializedZone,
181
- SerializedPlayer,
182
- SerializedSystem,
183
- },
184
- "Localized" : {
185
-
186
- // Localized versions of game components
187
- // All texts of these objects is parsed through the localizer already
188
- // should also have no circular refs
189
- LocalizedAction,
190
- LocalizedCard,
191
- LocalizedEffect,
192
- LocalizedZone,
193
- LocalizedPlayer,
194
- LocalizedSystem,
195
- }
196
- },
197
- "systemComponent" : {
198
-
199
- // Various short hand services
200
-
201
- // This one parses effect text, see more in later sections
202
- "effectTextParser" : Parser,
203
-
204
- // This one localizes the objects
205
- "localizer" : Localizer,
206
-
207
- // This one generate actions from a quick hand format
208
- "actionGenerator" : actionConstructorRegistry,
209
-
210
- // This one generates quick input array
211
- "inputRequester" : Request,
212
- },
213
- "displayComponent" : {
214
-
215
- // The parsed text is in an array of DisplayComponents
216
- // For adaptability with various renderer
217
-
218
- "ParentClass" : DisplayComponent,
219
- TextComponent,
220
- IconComponent,
221
- ReferenceComponent,
222
- ImageComponent,
223
- SymbolComponent,
224
- },
225
- "registry" : {
226
- // Registries are hard coded data
227
- // some are enums, some are const key -> value
228
-
229
- actionRegistry,
230
-
231
- cardDataRegistry,
232
-
233
- effectDataRegistry,
234
- effectTypeRegistry,
235
-
236
- operatorRegistry,
237
- operatorDataRegistry,
238
-
239
- rarityRegistry,
240
- rarityDataRegistry,
241
-
242
- subtypeRegistry,
243
-
244
- zoneRegistry,
245
- zoneDataRegistry,
246
- },
247
- "defaultSetting" : settings,
248
- "mod" : {
249
-
250
- //These are the class a mod must follows
251
- // and extends from
252
-
253
- GameModule,
254
- ParserModule,
255
- },
256
- };
219
+ import {queenSystemComponents} from "qpremake"
220
+ const {Renderer} = queenSystemComponents.systemComponent
257
221
  ```
258
222
 
259
- For a cheat sheet, here are the properties of systemComponent:
223
+ This class is as follows:
224
+
225
+ ```ts
226
+ abstract class Renderer {
227
+ abstract gameStart(
228
+ s: LocalizedSystem,
229
+ callback: () => any
230
+ ) : void;
231
+
232
+ abstract turnStart(
233
+ s: LocalizedSystem,
234
+ callback: (a? : Action) => any
235
+ ) : void;
236
+
237
+ abstract update(
238
+ phase: TurnPhase,
239
+ s: LocalizedSystem,
240
+ a: Action,
241
+ callback: () => any
242
+ ) : void;
243
+
244
+ abstract requestInput(
245
+ inputSet: inputData[],
246
+ phase: TurnPhase,
247
+ s: LocalizedSystem,
248
+ a: Action,
249
+ callback: (
250
+ input : inputData
251
+ ) => any
252
+ ) : void;
253
+ }
254
+ ```
255
+
256
+ These methods are called appropriately. There shoudl be guide comments when one implement these.
257
+
258
+ Notably, the system is paused after calling one of these. Sort of *"handing control over"* to the renderer. The system only resumes after **the provided callback()** is called.
259
+
260
+ One can make a new renderer to whatever front end frame work one likes by implementing this class.
261
+
262
+ ### Saving and loading game state:
263
+
264
+ Game state or more specifically is an instance of ```SerializedSystem```.
265
+
266
+ At any time, this is obtained via:
267
+
268
+ ```ts
269
+ s.toSerialized()
270
+ ```
271
+
272
+ This file can then be JSON and saved to a text file.
273
+
274
+ Loading said file is possible via the normal ```load()``` functionn before start:
275
+
276
+ ```ts
277
+ const data = fs.readFileSync(...) as SerializedSystem
278
+ s.load(data)
279
+ ```
280
+
281
+ ### Display texts
282
+
283
+ All texts provided via a ```Localized``` object is an array of ```Display components``` to guide the injection of icons and text formatting.
284
+
285
+ Those objects are available via:
286
+
287
+ ```ts
288
+ import {queenSystemComponents} from "qpremake"
289
+ const {TextComponent, IconComponent, ImageComponent} = queenSystemComponents.displayComponent
290
+ ```
260
291
 
261
- 1. gameComponent : holds various game component classes
262
- 2. systemComponent : holds various services to operate on data
263
- 3. displayComponent : holds display parsed segements
264
- 4. registry : holds data
265
- 5. defaultSetting : holds the default setting
266
- 6. mod : holds what format mods must follows
292
+ ### Handling inputs
267
293
 
268
- ### Utils
294
+ Whenever an action wants an input (say, when a card says choose a card, choose a space on the board, etc). The method ```requestInput``` of the renderer is called.
269
295
 
270
- Utils is a custom util object which hodl various utility methods. ts should suggest what it has already.
296
+ All possible inputs is in the ```inputSet``` components, all these are in one specific type (a card, a spot on the field, a number, etc).
271
297
 
272
- ## Pending Tasks
298
+ Inputs if required multiple are done sequentially. If a card wants the player to select 2 spots in the field, the request input function will be called twice for each.
299
+
300
+ At the start of the turn, there is also the need to select a **turn action**. Thus the ```turnStart``` method also have an option to continue with a player action.
301
+
302
+
303
+ # Modding
304
+
305
+ This section is dedicated to whomever wants to mod the system (add more cards, more localizations, etc).
306
+
307
+ ## What is a mod?
308
+
309
+ Mods are ts files that changes the data od the system
310
+
311
+ There are 2 types:
312
+
313
+ 1. gameplay mods, these can change what effects, cards, zones, characters, ... are possible
314
+ 2. parsing mods, these changes the behavior of how card text are parse and localized. (If one specifically target changing localization, look in a localization file.)
315
+
316
+ ## How mods are run
317
+
318
+ In the loading step of the system, mods are loaded and can change various registries via an API interface.
319
+
320
+ ## How to make a mod
321
+
322
+ There are 2 ways. One either can clone / fork [the github rerpo](https://github.com/BlueG15/qpRemake).
323
+ Or add stuff after installing the system in the setting.
324
+
325
+ Both are essentially the same but you appear on the npm of the project under contribution :).
326
+
327
+ ## Adding a mod
328
+
329
+ In the settings of the system, there is the field ```mods```, which stores an array of strings to code files inside the mod folder ("One can change this too").
330
+
331
+ A mod file exports default an implementation to the class ```mod``` available via:
332
+
333
+ ```ts
334
+ import {queenSystemComponents} from "qpremake"
335
+ const {GameModule, ParserModule} = queenSystemComponents.mod
336
+ ```
337
+
338
+ This game module is just this:
339
+
340
+ ```ts
341
+ class GameModule {
342
+ //should override, call upon load
343
+ load(API : registryAPI) : void {}
344
+ }
345
+ ```
346
+
347
+ Very simple. That registryAPI looks like this:
348
+
349
+ ```ts
350
+ interface registryAPI {
351
+ //SAFE registry edit
352
+ //There is also the registry for effectType and Action, but those doesnt need to be modified
353
+ registry_edit_card(key : string, value : cardData) : void;
354
+ registry_edit_effect_data(key : string, data : effectData) : void;
355
+ registry_edit_effect_class(
356
+ key : string,
357
+ constructors : typeof Effect | Record<string, typeof Effect>
358
+ ) : void;
359
+ registry_edit_effect(
360
+ key : string,
361
+ data : effectData,
362
+ constructors : typeof Effect | Record<string, typeof Effect>
363
+ ): void
364
+ registry_edit_effect_subtype(
365
+ key : string,
366
+ constructor : typeof EffectSubtype
367
+ ) : void;
368
+
369
+ registry_edit_zone_data(key : string, data : zoneData) : void;
370
+ registry_edit_zone_class(
371
+ key : string,
372
+ constructor : typeof Zone
373
+ ) : void;
374
+ registry_edit_zone(
375
+ key : string,
376
+ data : zoneData,
377
+ constructor : typeof Zone
378
+ ) : void;
379
+
380
+ //UNSFAFE registry edit
381
+ registry_edit_custom_action_handler(
382
+ actionIDs : number[],
383
+ handlerFunc : ((a : Action, system : queenSystem) => undefined | void | Action[])
384
+ ) : void;
385
+
386
+ //localization edit
387
+ registry_edit_localization(language : string, key : string, val : string) : void;
388
+
389
+ //... more coming
390
+ }
391
+ ```
392
+
393
+ These methods are passed into the mod for editting.
394
+
395
+ ## Example: Adding a custom effect
396
+
397
+ Effect have 2 parts, like almost every other gameplay components.
398
+
399
+ Those 2 parts are **Class part** and **Data part**
400
+
401
+ Those 2 parts are available via ```registry_edit_effect_data``` and ```registry_edit_effect_class``` respectively.
402
+
403
+ or both at the same time via ```registry_edit_effect```.
404
+
405
+ For this simple example, we ignore the data for now and implements the class part (data can be hard coded via the specified **effectData**) type.
406
+
407
+ We import the ```Effect``` class:
408
+
409
+ ```ts
410
+ import {queenSystemComponents} from "qpremake"
411
+ const {Effect} = queenSystemComponents.gameComponent
412
+ ```
413
+
414
+ And add it in:
415
+
416
+ ```ts
417
+ class CustomEffect extends Effect {
418
+ // Your implementation here
419
+ }
420
+
421
+ export default class customMod extends GameModule {
422
+ override load(API : registryAPI){
423
+ API.registry_edit_effect_class(
424
+ "customEffect1",
425
+ CustomEffect
426
+ )
427
+ }
428
+ }
429
+ ```
273
430
 
274
- 1. make effects
275
- 2. add more actions (if needed)
276
- 3. update the effect registry
277
- 4. update the card registry
278
- 5. add a deck registry
279
- 6. make level / wave control
280
- 7. make a good renderer
431
+ What an effect does and how to implement its behavior is in the **make effect** section below.
281
432
 
433
+ Importantly, one **MUST NOT** override the contructor.
282
434
 
435
+ # Project contribution
283
436
 
284
437
  ## Current progress:
285
438
 
@@ -1,7 +1,25 @@
1
1
  import type { Action } from "../handler/actionGenrator";
2
2
  import type { inputDataSpecific, inputType, TurnPhase } from "../../data/systemRegistry";
3
3
  import type { LocalizedSystem } from "../../types/abstract/serializedGameComponents/Localized";
4
- export interface qpRenderer {
4
+ export declare abstract class qpRenderer {
5
+ abstract gameStart(s: LocalizedSystem, callback: () => any): void;
6
+ abstract turnStart(s: LocalizedSystem, callback: (a?: Action) => any): void;
7
+ /**
8
+ * update is called upon every game update for every phase for whatever reason
9
+ * right after applying the action to the game states
10
+ * call callback() to conttinue */
11
+ abstract update(phase: TurnPhase, s: LocalizedSystem, a: Action, callback: () => any): void;
12
+ /**
13
+ * request input is called wheever the system is processing an action and wants a user input
14
+ * @param inputSet : a array of allowed inputs
15
+ * @param phase : phase
16
+ * @param s : system state
17
+ * @param a : action
18
+ * @param callback : callback function, call to continue
19
+ */
20
+ abstract requestInput<T extends inputType>(inputSet: inputDataSpecific<T>[], phase: TurnPhase, s: LocalizedSystem, a: Action, callback: (input: inputDataSpecific<T>) => any): void;
21
+ }
22
+ export declare class sampleRenderer extends qpRenderer {
5
23
  gameStart(s: LocalizedSystem, callback: () => any): void;
6
24
  turnStart(s: LocalizedSystem, callback: (a?: Action) => any): void;
7
25
  update(phase: TurnPhase, s: LocalizedSystem, a: Action, callback: () => any): void;
@@ -1,2 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sampleRenderer = exports.qpRenderer = void 0;
4
+ class qpRenderer {
5
+ }
6
+ exports.qpRenderer = qpRenderer;
7
+ class sampleRenderer extends qpRenderer {
8
+ gameStart(s, callback) {
9
+ console.log("Game start called");
10
+ return callback();
11
+ }
12
+ turnStart(s, callback) {
13
+ console.log(`Turn start called`);
14
+ return callback();
15
+ }
16
+ update(phase, s, a, callback) {
17
+ console.log(`Update called on phase ${phase}, on action ${a.type}`);
18
+ return callback();
19
+ }
20
+ requestInput(inputSet, phase, s, a, callback) {
21
+ console.log(`Input requested, continue with 1st input`);
22
+ return callback(inputSet[0]);
23
+ }
24
+ }
25
+ exports.sampleRenderer = sampleRenderer;
package/lib/index.d.ts CHANGED
@@ -29,6 +29,7 @@ import LockEffect from "./types/effects/effectTypes/lockEffect";
29
29
  import ManualEffect from "./types/effects/effectTypes/manualEffect";
30
30
  import PassiveEffect from "./types/effects/effectTypes/passiveEffect";
31
31
  import TriggerEffect from "./types/effects/effectTypes/triggerEffect";
32
+ import { defaultSetting, Setting } from "./types/abstract/gameComponents/settings";
32
33
  import { SerializedCard, Serialized_effect, SerializedPlayer, SerializedSystem, SerializedZone } from "./types/abstract/serializedGameComponents/Gamestate";
33
34
  import { LocalizedAction, LocalizedCard, LocalizedEffect, LocalizedPlayer, LocalizedSystem, LocalizedZone } from "./types/abstract/serializedGameComponents/Localized";
34
35
  import Parser from "./effectTextParser";
@@ -43,6 +44,7 @@ import { operatorRegistry } from "./data/operatorRegistry";
43
44
  import { rarityRegistry } from "./data/rarityRegistry";
44
45
  import { zoneRegistry } from "./data/zoneRegistry";
45
46
  import subtypeRegistry from "./data/subtypeRegistry";
47
+ import { qpRenderer, sampleRenderer } from "./_queenSystem/renderer/rendererInterface";
46
48
  declare const queenSystemComponents: {
47
49
  gameComponent: {
48
50
  Action: typeof Action_class;
@@ -99,9 +101,9 @@ declare const queenSystemComponents: {
99
101
  };
100
102
  };
101
103
  systemComponent: {
102
- effectTextParser: typeof Parser;
103
- localizer: typeof Localizer;
104
- actionGenerator: {
104
+ EffectTextParser: typeof Parser;
105
+ Localizer: typeof Localizer;
106
+ ActionGenerator: {
105
107
  readonly error: (cause: import("./data/systemRegistry").identificationInfo) => Action_class<[import("./data/systemRegistry").identificationInfo_none], never, {}>;
106
108
  readonly a_null: (cause: import("./data/systemRegistry").identificationInfo) => Action_class<[import("./data/systemRegistry").identificationInfo_none], never, {}>;
107
109
  readonly a_negate_action: (cause: import("./data/systemRegistry").identificationInfo) => Action_class<[import("./data/systemRegistry").identificationInfo_none], never, {}>;
@@ -2337,7 +2339,7 @@ declare const queenSystemComponents: {
2337
2339
  delayEID: string;
2338
2340
  }>;
2339
2341
  };
2340
- inputRequester: {
2342
+ InputRequester: {
2341
2343
  field(s: import("./data/systemRegistry").dry_system, c: import("./types/misc").Player_specific | import("./types/misc").Positionable): {
2342
2344
  s: import("./data/systemRegistry").dry_system;
2343
2345
  zones: import("./data/systemRegistry").dry_zone[];
@@ -2391,7 +2393,7 @@ declare const queenSystemComponents: {
2391
2393
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2392
2394
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2393
2395
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2394
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
2396
+ setting: import("./types/misc").Readonly_recur<Setting>;
2395
2397
  } & {
2396
2398
  ___zone: import("./data/systemRegistry").dry_zone;
2397
2399
  })[];
@@ -2503,7 +2505,7 @@ declare const queenSystemComponents: {
2503
2505
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2504
2506
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2505
2507
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2506
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
2508
+ setting: import("./types/misc").Readonly_recur<Setting>;
2507
2509
  } & {
2508
2510
  ___zone: import("./data/systemRegistry").dry_zone;
2509
2511
  }) => boolean): /*elided*/ any;
@@ -2585,7 +2587,7 @@ declare const queenSystemComponents: {
2585
2587
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2586
2588
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2587
2589
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2588
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
2590
+ setting: import("./types/misc").Readonly_recur<Setting>;
2589
2591
  } & {
2590
2592
  ___zone: import("./data/systemRegistry").dry_zone;
2591
2593
  })[];
@@ -2652,7 +2654,7 @@ declare const queenSystemComponents: {
2652
2654
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2653
2655
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2654
2656
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2655
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
2657
+ setting: import("./types/misc").Readonly_recur<Setting>;
2656
2658
  } & {
2657
2659
  ___zone: import("./data/systemRegistry").dry_zone;
2658
2660
  }) => boolean): /*elided*/ any;
@@ -2741,7 +2743,7 @@ declare const queenSystemComponents: {
2741
2743
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2742
2744
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2743
2745
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2744
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
2746
+ setting: import("./types/misc").Readonly_recur<Setting>;
2745
2747
  } & {
2746
2748
  ___zone: import("./data/systemRegistry").dry_zone;
2747
2749
  })[];
@@ -2853,7 +2855,7 @@ declare const queenSystemComponents: {
2853
2855
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2854
2856
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2855
2857
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2856
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
2858
+ setting: import("./types/misc").Readonly_recur<Setting>;
2857
2859
  } & {
2858
2860
  ___zone: import("./data/systemRegistry").dry_zone;
2859
2861
  }) => boolean): /*elided*/ any;
@@ -2935,7 +2937,7 @@ declare const queenSystemComponents: {
2935
2937
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2936
2938
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2937
2939
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
2938
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
2940
+ setting: import("./types/misc").Readonly_recur<Setting>;
2939
2941
  } & {
2940
2942
  ___zone: import("./data/systemRegistry").dry_zone;
2941
2943
  })[];
@@ -3002,7 +3004,7 @@ declare const queenSystemComponents: {
3002
3004
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3003
3005
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3004
3006
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3005
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3007
+ setting: import("./types/misc").Readonly_recur<Setting>;
3006
3008
  } & {
3007
3009
  ___zone: import("./data/systemRegistry").dry_zone;
3008
3010
  }) => boolean): /*elided*/ any;
@@ -3091,7 +3093,7 @@ declare const queenSystemComponents: {
3091
3093
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3092
3094
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3093
3095
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3094
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3096
+ setting: import("./types/misc").Readonly_recur<Setting>;
3095
3097
  } & {
3096
3098
  ___zone: import("./data/systemRegistry").dry_zone;
3097
3099
  })[];
@@ -3203,7 +3205,7 @@ declare const queenSystemComponents: {
3203
3205
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3204
3206
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3205
3207
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3206
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3208
+ setting: import("./types/misc").Readonly_recur<Setting>;
3207
3209
  } & {
3208
3210
  ___zone: import("./data/systemRegistry").dry_zone;
3209
3211
  }) => boolean): /*elided*/ any;
@@ -3285,7 +3287,7 @@ declare const queenSystemComponents: {
3285
3287
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3286
3288
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3287
3289
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3288
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3290
+ setting: import("./types/misc").Readonly_recur<Setting>;
3289
3291
  } & {
3290
3292
  ___zone: import("./data/systemRegistry").dry_zone;
3291
3293
  })[];
@@ -3352,7 +3354,7 @@ declare const queenSystemComponents: {
3352
3354
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3353
3355
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3354
3356
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3355
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3357
+ setting: import("./types/misc").Readonly_recur<Setting>;
3356
3358
  } & {
3357
3359
  ___zone: import("./data/systemRegistry").dry_zone;
3358
3360
  }) => boolean): /*elided*/ any;
@@ -3441,7 +3443,7 @@ declare const queenSystemComponents: {
3441
3443
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3442
3444
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3443
3445
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3444
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3446
+ setting: import("./types/misc").Readonly_recur<Setting>;
3445
3447
  } & {
3446
3448
  ___zone: import("./data/systemRegistry").dry_zone;
3447
3449
  })[];
@@ -3553,7 +3555,7 @@ declare const queenSystemComponents: {
3553
3555
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3554
3556
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3555
3557
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3556
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3558
+ setting: import("./types/misc").Readonly_recur<Setting>;
3557
3559
  } & {
3558
3560
  ___zone: import("./data/systemRegistry").dry_zone;
3559
3561
  }) => boolean): /*elided*/ any;
@@ -3635,7 +3637,7 @@ declare const queenSystemComponents: {
3635
3637
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3636
3638
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3637
3639
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3638
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3640
+ setting: import("./types/misc").Readonly_recur<Setting>;
3639
3641
  } & {
3640
3642
  ___zone: import("./data/systemRegistry").dry_zone;
3641
3643
  })[];
@@ -3702,7 +3704,7 @@ declare const queenSystemComponents: {
3702
3704
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3703
3705
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3704
3706
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3705
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3707
+ setting: import("./types/misc").Readonly_recur<Setting>;
3706
3708
  } & {
3707
3709
  ___zone: import("./data/systemRegistry").dry_zone;
3708
3710
  }) => boolean): /*elided*/ any;
@@ -3791,7 +3793,7 @@ declare const queenSystemComponents: {
3791
3793
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3792
3794
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3793
3795
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3794
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3796
+ setting: import("./types/misc").Readonly_recur<Setting>;
3795
3797
  } & {
3796
3798
  ___zone: import("./data/systemRegistry").dry_zone;
3797
3799
  })[];
@@ -3903,7 +3905,7 @@ declare const queenSystemComponents: {
3903
3905
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3904
3906
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3905
3907
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3906
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3908
+ setting: import("./types/misc").Readonly_recur<Setting>;
3907
3909
  } & {
3908
3910
  ___zone: import("./data/systemRegistry").dry_zone;
3909
3911
  }) => boolean): /*elided*/ any;
@@ -3985,7 +3987,7 @@ declare const queenSystemComponents: {
3985
3987
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3986
3988
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3987
3989
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
3988
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
3990
+ setting: import("./types/misc").Readonly_recur<Setting>;
3989
3991
  } & {
3990
3992
  ___zone: import("./data/systemRegistry").dry_zone;
3991
3993
  })[];
@@ -4052,7 +4054,7 @@ declare const queenSystemComponents: {
4052
4054
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4053
4055
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4054
4056
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4055
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4057
+ setting: import("./types/misc").Readonly_recur<Setting>;
4056
4058
  } & {
4057
4059
  ___zone: import("./data/systemRegistry").dry_zone;
4058
4060
  }) => boolean): /*elided*/ any;
@@ -4141,7 +4143,7 @@ declare const queenSystemComponents: {
4141
4143
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4142
4144
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4143
4145
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4144
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4146
+ setting: import("./types/misc").Readonly_recur<Setting>;
4145
4147
  } & {
4146
4148
  ___zone: import("./data/systemRegistry").dry_zone;
4147
4149
  })[];
@@ -4253,7 +4255,7 @@ declare const queenSystemComponents: {
4253
4255
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4254
4256
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4255
4257
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4256
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4258
+ setting: import("./types/misc").Readonly_recur<Setting>;
4257
4259
  } & {
4258
4260
  ___zone: import("./data/systemRegistry").dry_zone;
4259
4261
  }) => boolean): /*elided*/ any;
@@ -4335,7 +4337,7 @@ declare const queenSystemComponents: {
4335
4337
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4336
4338
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4337
4339
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4338
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4340
+ setting: import("./types/misc").Readonly_recur<Setting>;
4339
4341
  } & {
4340
4342
  ___zone: import("./data/systemRegistry").dry_zone;
4341
4343
  })[];
@@ -4402,7 +4404,7 @@ declare const queenSystemComponents: {
4402
4404
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4403
4405
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4404
4406
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4405
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4407
+ setting: import("./types/misc").Readonly_recur<Setting>;
4406
4408
  } & {
4407
4409
  ___zone: import("./data/systemRegistry").dry_zone;
4408
4410
  }) => boolean): /*elided*/ any;
@@ -4491,7 +4493,7 @@ declare const queenSystemComponents: {
4491
4493
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4492
4494
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4493
4495
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4494
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4496
+ setting: import("./types/misc").Readonly_recur<Setting>;
4495
4497
  } & {
4496
4498
  ___zone: import("./data/systemRegistry").dry_zone;
4497
4499
  })[];
@@ -4603,7 +4605,7 @@ declare const queenSystemComponents: {
4603
4605
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4604
4606
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4605
4607
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4606
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4608
+ setting: import("./types/misc").Readonly_recur<Setting>;
4607
4609
  } & {
4608
4610
  ___zone: import("./data/systemRegistry").dry_zone;
4609
4611
  }) => boolean): /*elided*/ any;
@@ -4685,7 +4687,7 @@ declare const queenSystemComponents: {
4685
4687
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4686
4688
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4687
4689
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4688
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4690
+ setting: import("./types/misc").Readonly_recur<Setting>;
4689
4691
  } & {
4690
4692
  ___zone: import("./data/systemRegistry").dry_zone;
4691
4693
  })[];
@@ -4752,7 +4754,7 @@ declare const queenSystemComponents: {
4752
4754
  statusEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4753
4755
  effects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4754
4756
  totalEffects: ReadonlyArray<import("./data/systemRegistry").dry_effect>;
4755
- setting: import("./types/misc").Readonly_recur<import("./types/abstract/gameComponents/settings").Setting>;
4757
+ setting: import("./types/misc").Readonly_recur<Setting>;
4756
4758
  } & {
4757
4759
  ___zone: import("./data/systemRegistry").dry_zone;
4758
4760
  }) => boolean): /*elided*/ any;
@@ -4796,6 +4798,8 @@ declare const queenSystemComponents: {
4796
4798
  many<L extends number>(l: L, e?: Effect<any>): import("./_queenSystem/handler/actionInputGenerator").inputRequester_multiple<import("./data/systemRegistry").inputType.number, L>;
4797
4799
  };
4798
4800
  };
4801
+ Renderer: typeof qpRenderer;
4802
+ SampleRenderer: typeof sampleRenderer;
4799
4803
  };
4800
4804
  displayComponent: {
4801
4805
  ParentClass: typeof DisplayComponent;
@@ -6318,7 +6322,10 @@ declare const queenSystemComponents: {
6318
6322
  zoneRegistry: typeof zoneRegistry;
6319
6323
  zoneDataRegistry: Record<"z_system" | "z_drop" | "z_void" | "z_deck" | "z_field" | "z_grave" | "z_hand" | "z_storage" | "z_ability", import("./data/zoneRegistry").zoneData>;
6320
6324
  };
6321
- defaultSetting: import("./types/abstract/gameComponents/settings").defaultSetting;
6325
+ setting: {
6326
+ defaultSetting: typeof defaultSetting;
6327
+ settingClass: typeof Setting;
6328
+ };
6322
6329
  mod: {
6323
6330
  GameModule: typeof GameModule;
6324
6331
  ParserModule: typeof ParserModule;
@@ -6326,16 +6333,3 @@ declare const queenSystemComponents: {
6326
6333
  };
6327
6334
  export { queenSystem, queenSystemComponents, Utils as queenSystemUtils };
6328
6335
  export default queenSystem;
6329
- /**
6330
- * Usage :
6331
- *
6332
- * let setting = new defaultSetting()
6333
- let renderer = new qpTerminalRenderer()
6334
- let s = new queenSystem(setting, renderer)
6335
- renderer.bind(s)
6336
- s.addPlayers("player", operatorRegistry.o_esper)
6337
- s.addPlayers("enemy", operatorRegistry.o_null)
6338
- await s.load()
6339
-
6340
- renderer.start();
6341
- */
package/lib/index.js CHANGED
@@ -82,7 +82,7 @@ const manualEffect_1 = __importDefault(require("./types/effects/effectTypes/manu
82
82
  const passiveEffect_1 = __importDefault(require("./types/effects/effectTypes/passiveEffect"));
83
83
  const triggerEffect_1 = __importDefault(require("./types/effects/effectTypes/triggerEffect"));
84
84
  // default settings
85
- const settings_1 = __importDefault(require("./types/abstract/gameComponents/settings"));
85
+ const settings_1 = require("./types/abstract/gameComponents/settings");
86
86
  // serialized
87
87
  const Gamestate_1 = require("./types/abstract/serializedGameComponents/Gamestate");
88
88
  // localized
@@ -108,6 +108,7 @@ const operatorRegistry_1 = __importStar(require("./data/operatorRegistry"));
108
108
  const rarityRegistry_1 = __importStar(require("./data/rarityRegistry"));
109
109
  const zoneRegistry_1 = __importStar(require("./data/zoneRegistry"));
110
110
  const subtypeRegistry_1 = __importDefault(require("./data/subtypeRegistry"));
111
+ const rendererInterface_1 = require("./_queenSystem/renderer/rendererInterface");
111
112
  const queenSystemComponents = {
112
113
  "gameComponent": {
113
114
  "Action": actionGenrator_1.Action_class,
@@ -163,10 +164,12 @@ const queenSystemComponents = {
163
164
  }
164
165
  },
165
166
  "systemComponent": {
166
- "effectTextParser": effectTextParser_1.default,
167
- "localizer": localizationHandler_1.default,
168
- "actionGenerator": actionGenrator_1.actionConstructorRegistry,
169
- "inputRequester": actionInputRequesterGenerator_1.default,
167
+ "EffectTextParser": effectTextParser_1.default,
168
+ "Localizer": localizationHandler_1.default,
169
+ "ActionGenerator": actionGenrator_1.actionConstructorRegistry,
170
+ "InputRequester": actionInputRequesterGenerator_1.default,
171
+ "Renderer": rendererInterface_1.qpRenderer,
172
+ "SampleRenderer": rendererInterface_1.sampleRenderer,
170
173
  },
171
174
  "displayComponent": {
172
175
  "ParentClass": parser_1.DisplayComponent,
@@ -189,7 +192,10 @@ const queenSystemComponents = {
189
192
  zoneRegistry: zoneRegistry_1.zoneRegistry,
190
193
  zoneDataRegistry: zoneRegistry_1.default,
191
194
  },
192
- "defaultSetting": settings_1.default,
195
+ "setting": {
196
+ defaultSetting: settings_1.defaultSetting,
197
+ "settingClass": settings_1.Setting,
198
+ },
193
199
  "mod": {
194
200
  GameModule: gameModule_1.default,
195
201
  ParserModule: effectTextParserModule_1.ParserModule,
@@ -197,16 +203,3 @@ const queenSystemComponents = {
197
203
  };
198
204
  exports.queenSystemComponents = queenSystemComponents;
199
205
  exports.default = queenSystem_1.default;
200
- /**
201
- * Usage :
202
- *
203
- * let setting = new defaultSetting()
204
- let renderer = new qpTerminalRenderer()
205
- let s = new queenSystem(setting, renderer)
206
- renderer.bind(s)
207
- s.addPlayers("player", operatorRegistry.o_esper)
208
- s.addPlayers("enemy", operatorRegistry.o_null)
209
- await s.load()
210
-
211
- renderer.start();
212
- */
@@ -27,31 +27,31 @@ declare enum auto_input_option {
27
27
  last = 3,//auto chooses the last option
28
28
  random = 4
29
29
  }
30
- interface Setting {
31
- languageID: supporttedLanguages;
32
- dynamic_id_len: number;
33
- id_style: id_style;
34
- id_separator: string;
35
- max_id_count: number;
36
- effectFolder: string;
37
- effectFiles: string[];
38
- mods: string[];
39
- modFolder_game: string;
40
- modFolder_parser: string;
41
- localizationFolder: string;
42
- ignore_undefined_subtype: boolean;
43
- ignore_undefined_effect: boolean;
44
- show_negative_stat: boolean;
45
- auto_input: auto_input_option;
46
- ignore_invalid_partition_mapping: boolean;
47
- global_partition_setting: partitionSetting;
48
- default_partition_behavior: partitionActivationBehavior;
49
- parser_modules: string[];
50
- singleton_effect_subtype: boolean;
51
- singleton_effect_type: boolean;
52
- spawn_instanced_zones_per_player: boolean;
30
+ declare abstract class Setting {
31
+ abstract languageID: supporttedLanguages;
32
+ abstract dynamic_id_len: number;
33
+ abstract id_style: id_style;
34
+ abstract id_separator: string;
35
+ abstract max_id_count: number;
36
+ abstract effectFolder: string;
37
+ abstract effectFiles: string[];
38
+ abstract mods: string[];
39
+ abstract modFolder_game: string;
40
+ abstract modFolder_parser: string;
41
+ abstract localizationFolder: string;
42
+ abstract ignore_undefined_subtype: boolean;
43
+ abstract ignore_undefined_effect: boolean;
44
+ abstract show_negative_stat: boolean;
45
+ abstract auto_input: auto_input_option;
46
+ abstract ignore_invalid_partition_mapping: boolean;
47
+ abstract global_partition_setting: partitionSetting;
48
+ abstract default_partition_behavior: partitionActivationBehavior;
49
+ abstract parser_modules: string[];
50
+ abstract singleton_effect_subtype: boolean;
51
+ abstract singleton_effect_type: boolean;
52
+ abstract spawn_instanced_zones_per_player: boolean;
53
53
  }
54
- declare class defaultSetting implements Setting {
54
+ declare class defaultSetting extends Setting {
55
55
  languageID: supporttedLanguages;
56
56
  mods: never[];
57
57
  dynamic_id_len: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.id_style = exports.auto_input_option = exports.supporttedLanguages = exports.defaultSetting = exports.partitionSetting = void 0;
3
+ exports.id_style = exports.auto_input_option = exports.supporttedLanguages = exports.defaultSetting = exports.Setting = exports.partitionSetting = void 0;
4
4
  const cardRegistry_1 = require("../../../data/cardRegistry");
5
5
  var partitionSetting;
6
6
  (function (partitionSetting) {
@@ -33,8 +33,12 @@ var auto_input_option;
33
33
  auto_input_option[auto_input_option["last"] = 3] = "last";
34
34
  auto_input_option[auto_input_option["random"] = 4] = "random";
35
35
  })(auto_input_option || (exports.auto_input_option = auto_input_option = {}));
36
- class defaultSetting {
36
+ class Setting {
37
+ }
38
+ exports.Setting = Setting;
39
+ class defaultSetting extends Setting {
37
40
  constructor() {
41
+ super(...arguments);
38
42
  this.languageID = supporttedLanguages.English;
39
43
  this.mods = []; //no mods
40
44
  this.dynamic_id_len = 5;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "qpremake",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "Remake of the qp engine in ts / js, with moddability in mind",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "node ./lib/testFile.js",
9
- "build": "tsc",
9
+ "build": "(IF EXIST \".\\lib\" RD /S /Q \".\\lib\") && tsc",
10
10
  "dev": "npm run build && npm run test",
11
11
  "prepublishOnly" : "npm run build"
12
12
  },