qpremake 1.5.2 → 1.6.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.
Files changed (234) hide show
  1. package/README.md +335 -180
  2. package/package.json +2 -7
  3. package/lib/_localizationFiles/English.d.ts +0 -2
  4. package/lib/_localizationFiles/English.js +0 -307
  5. package/lib/_mods/parserModules/addSymbol.d.ts +0 -7
  6. package/lib/_mods/parserModules/addSymbol.js +0 -18
  7. package/lib/_mods/parserModules/expression.d.ts +0 -7
  8. package/lib/_mods/parserModules/expression.js +0 -45
  9. package/lib/_mods/parserModules/expression_parser.d.ts +0 -143
  10. package/lib/_mods/parserModules/expression_parser.js +0 -728
  11. package/lib/_mods/parserModules/img.d.ts +0 -8
  12. package/lib/_mods/parserModules/img.js +0 -42
  13. package/lib/_mods/parserModules/qpOriginal.d.ts +0 -5
  14. package/lib/_mods/parserModules/qpOriginal.js +0 -27
  15. package/lib/_mods/parserModules/sectionID.d.ts +0 -13
  16. package/lib/_mods/parserModules/sectionID.js +0 -56
  17. package/lib/_mods/parserModules/tags.d.ts +0 -9
  18. package/lib/_mods/parserModules/tags.js +0 -29
  19. package/lib/_mods/parserModules/uaddminus.d.ts +0 -9
  20. package/lib/_mods/parserModules/uaddminus.js +0 -42
  21. package/lib/_mods/parserModules/variantCheck.d.ts +0 -10
  22. package/lib/_mods/parserModules/variantCheck.js +0 -53
  23. package/lib/_queenSystem/handler/actionGenrator.d.ts +0 -994
  24. package/lib/_queenSystem/handler/actionGenrator.js +0 -646
  25. package/lib/_queenSystem/handler/actionInputGenerator.d.ts +0 -95
  26. package/lib/_queenSystem/handler/actionInputGenerator.js +0 -373
  27. package/lib/_queenSystem/handler/actionInputRequesterGenerator.d.ts +0 -92
  28. package/lib/_queenSystem/handler/actionInputRequesterGenerator.js +0 -341
  29. package/lib/_queenSystem/handler/cardHandler.d.ts +0 -20
  30. package/lib/_queenSystem/handler/cardHandler.js +0 -61
  31. package/lib/_queenSystem/handler/effectGenerator.d.ts +0 -1
  32. package/lib/_queenSystem/handler/effectGenerator.js +0 -127
  33. package/lib/_queenSystem/handler/localizationHandler.d.ts +0 -28
  34. package/lib/_queenSystem/handler/localizationHandler.js +0 -166
  35. package/lib/_queenSystem/handler/modHandler.d.ts +0 -10
  36. package/lib/_queenSystem/handler/modHandler.js +0 -36
  37. package/lib/_queenSystem/handler/oldDataProcessor.d.ts +0 -9
  38. package/lib/_queenSystem/handler/oldDataProcessor.js +0 -129
  39. package/lib/_queenSystem/handler/registryHandler.d.ts +0 -36
  40. package/lib/_queenSystem/handler/registryHandler.js +0 -63
  41. package/lib/_queenSystem/handler/zoneHandler.d.ts +0 -102
  42. package/lib/_queenSystem/handler/zoneHandler.js +0 -606
  43. package/lib/_queenSystem/loader/loader_card.d.ts +0 -20
  44. package/lib/_queenSystem/loader/loader_card.js +0 -124
  45. package/lib/_queenSystem/loader/loader_effect.d.ts +0 -27
  46. package/lib/_queenSystem/loader/loader_effect.js +0 -163
  47. package/lib/_queenSystem/loader/loader_handler.d.ts +0 -11
  48. package/lib/_queenSystem/loader/loader_handler.js +0 -24
  49. package/lib/_queenSystem/loader/loader_localization.d.ts +0 -11
  50. package/lib/_queenSystem/loader/loader_localization.js +0 -73
  51. package/lib/_queenSystem/loader/loader_mod.d.ts +0 -10
  52. package/lib/_queenSystem/loader/loader_mod.js +0 -72
  53. package/lib/_queenSystem/loader/loader_subtype.d.ts +0 -9
  54. package/lib/_queenSystem/loader/loader_subtype.js +0 -39
  55. package/lib/_queenSystem/loader/loader_type.d.ts +0 -9
  56. package/lib/_queenSystem/loader/loader_type.js +0 -39
  57. package/lib/_queenSystem/loader/loader_zone.d.ts +0 -14
  58. package/lib/_queenSystem/loader/loader_zone.js +0 -35
  59. package/lib/_queenSystem/queenSystem.d.ts +0 -127
  60. package/lib/_queenSystem/queenSystem.js +0 -996
  61. package/lib/_queenSystem/renderer/rendererInterface.d.ts +0 -9
  62. package/lib/_queenSystem/renderer/rendererInterface.js +0 -2
  63. package/lib/data/actionRegistry.d.ts +0 -56
  64. package/lib/data/actionRegistry.js +0 -60
  65. package/lib/data/cardRegistry.d.ts +0 -1162
  66. package/lib/data/cardRegistry.js +0 -716
  67. package/lib/data/deckRegistry.d.ts +0 -19
  68. package/lib/data/deckRegistry.js +0 -41
  69. package/lib/data/effectRegistry.d.ts +0 -465
  70. package/lib/data/effectRegistry.js +0 -151
  71. package/lib/data/effectTypeRegistry.d.ts +0 -14
  72. package/lib/data/effectTypeRegistry.js +0 -14
  73. package/lib/data/operatorRegistry.d.ts +0 -92
  74. package/lib/data/operatorRegistry.js +0 -82
  75. package/lib/data/rarityRegistry.d.ts +0 -28
  76. package/lib/data/rarityRegistry.js +0 -63
  77. package/lib/data/registryRegistry.d.ts +0 -10
  78. package/lib/data/registryRegistry.js +0 -14
  79. package/lib/data/subtypeRegistry.d.ts +0 -15
  80. package/lib/data/subtypeRegistry.js +0 -15
  81. package/lib/data/systemRegistry.d.ts +0 -253
  82. package/lib/data/systemRegistry.js +0 -56
  83. package/lib/data/zoneRegistry.d.ts +0 -43
  84. package/lib/data/zoneRegistry.js +0 -157
  85. package/lib/effectTextParser/index.d.ts +0 -42
  86. package/lib/effectTextParser/index.js +0 -316
  87. package/lib/global/index.d.ts +0 -8
  88. package/lib/global/index.js +0 -12
  89. package/lib/index.d.ts +0 -6341
  90. package/lib/index.js +0 -212
  91. package/lib/specificEffects/e_cond.d.ts +0 -11
  92. package/lib/specificEffects/e_cond.js +0 -36
  93. package/lib/specificEffects/e_fruit.d.ts +0 -3
  94. package/lib/specificEffects/e_fruit.js +0 -187
  95. package/lib/specificEffects/e_generic.d.ts +0 -191
  96. package/lib/specificEffects/e_generic.js +0 -662
  97. package/lib/specificEffects/e_generic_cardTargetting.d.ts +0 -38
  98. package/lib/specificEffects/e_generic_cardTargetting.js +0 -82
  99. package/lib/specificEffects/e_generic_noneTargetting.d.ts +0 -10
  100. package/lib/specificEffects/e_generic_noneTargetting.js +0 -26
  101. package/lib/specificEffects/e_status.d.ts +0 -80
  102. package/lib/specificEffects/e_status.js +0 -151
  103. package/lib/specificEffects/e_test.d.ts +0 -3
  104. package/lib/specificEffects/e_test.js +0 -21
  105. package/lib/types/abstract/gameComponents/API.d.ts +0 -19
  106. package/lib/types/abstract/gameComponents/API.js +0 -2
  107. package/lib/types/abstract/gameComponents/card.d.ts +0 -108
  108. package/lib/types/abstract/gameComponents/card.js +0 -771
  109. package/lib/types/abstract/gameComponents/effect.d.ts +0 -82
  110. package/lib/types/abstract/gameComponents/effect.js +0 -331
  111. package/lib/types/abstract/gameComponents/effectSubtype.d.ts +0 -22
  112. package/lib/types/abstract/gameComponents/effectSubtype.js +0 -40
  113. package/lib/types/abstract/gameComponents/effectType.d.ts +0 -11
  114. package/lib/types/abstract/gameComponents/effectType.js +0 -8
  115. package/lib/types/abstract/gameComponents/settings.d.ts +0 -80
  116. package/lib/types/abstract/gameComponents/settings.js +0 -68
  117. package/lib/types/abstract/gameComponents/zone.d.ts +0 -113
  118. package/lib/types/abstract/gameComponents/zone.js +0 -614
  119. package/lib/types/abstract/gameComponents/zone_gridBased.d.ts +0 -18
  120. package/lib/types/abstract/gameComponents/zone_gridBased.js +0 -58
  121. package/lib/types/abstract/gameComponents/zone_stackBased.d.ts +0 -13
  122. package/lib/types/abstract/gameComponents/zone_stackBased.js +0 -55
  123. package/lib/types/abstract/generics/node.d.ts +0 -23
  124. package/lib/types/abstract/generics/node.js +0 -46
  125. package/lib/types/abstract/generics/position.d.ts +0 -23
  126. package/lib/types/abstract/generics/position.js +0 -91
  127. package/lib/types/abstract/generics/tree.d.ts +0 -25
  128. package/lib/types/abstract/generics/tree.js +0 -153
  129. package/lib/types/abstract/generics/universalResponse.d.ts +0 -4
  130. package/lib/types/abstract/generics/universalResponse.js +0 -2
  131. package/lib/types/abstract/generics/wraper.d.ts +0 -21
  132. package/lib/types/abstract/generics/wraper.js +0 -56
  133. package/lib/types/abstract/parser/component.d.ts +0 -88
  134. package/lib/types/abstract/parser/component.js +0 -132
  135. package/lib/types/abstract/parser/index.d.ts +0 -6
  136. package/lib/types/abstract/parser/index.js +0 -28
  137. package/lib/types/abstract/parser/modPack.d.ts +0 -21
  138. package/lib/types/abstract/parser/modPack.js +0 -48
  139. package/lib/types/abstract/parser/moduleInputObject.d.ts +0 -12
  140. package/lib/types/abstract/parser/moduleInputObject.js +0 -21
  141. package/lib/types/abstract/parser/options.d.ts +0 -31
  142. package/lib/types/abstract/parser/options.js +0 -45
  143. package/lib/types/abstract/serializedGameComponents/Gamestate.d.ts +0 -46
  144. package/lib/types/abstract/serializedGameComponents/Gamestate.js +0 -70
  145. package/lib/types/abstract/serializedGameComponents/Localized.d.ts +0 -69
  146. package/lib/types/abstract/serializedGameComponents/Localized.js +0 -84
  147. package/lib/types/defaultZones/ability.d.ts +0 -10
  148. package/lib/types/defaultZones/ability.js +0 -22
  149. package/lib/types/defaultZones/deck.d.ts +0 -25
  150. package/lib/types/defaultZones/deck.js +0 -90
  151. package/lib/types/defaultZones/drop.d.ts +0 -5
  152. package/lib/types/defaultZones/drop.js +0 -13
  153. package/lib/types/defaultZones/field.d.ts +0 -11
  154. package/lib/types/defaultZones/field.js +0 -35
  155. package/lib/types/defaultZones/grave.d.ts +0 -8
  156. package/lib/types/defaultZones/grave.js +0 -21
  157. package/lib/types/defaultZones/hand.d.ts +0 -5
  158. package/lib/types/defaultZones/hand.js +0 -14
  159. package/lib/types/defaultZones/storage.d.ts +0 -9
  160. package/lib/types/defaultZones/storage.js +0 -21
  161. package/lib/types/defaultZones/system.d.ts +0 -12
  162. package/lib/types/defaultZones/system.js +0 -35
  163. package/lib/types/defaultZones/void.d.ts +0 -4
  164. package/lib/types/defaultZones/void.js +0 -10
  165. package/lib/types/effects/effectSubtypes/subtype_chained.d.ts +0 -10
  166. package/lib/types/effects/effectSubtypes/subtype_chained.js +0 -17
  167. package/lib/types/effects/effectSubtypes/subtype_delayed.d.ts +0 -9
  168. package/lib/types/effects/effectSubtypes/subtype_delayed.js +0 -16
  169. package/lib/types/effects/effectSubtypes/subtype_fieldLock.d.ts +0 -9
  170. package/lib/types/effects/effectSubtypes/subtype_fieldLock.js +0 -21
  171. package/lib/types/effects/effectSubtypes/subtype_graveLock.d.ts +0 -9
  172. package/lib/types/effects/effectSubtypes/subtype_graveLock.js +0 -21
  173. package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.d.ts +0 -9
  174. package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.js +0 -21
  175. package/lib/types/effects/effectSubtypes/subtype_hardUnique.d.ts +0 -9
  176. package/lib/types/effects/effectSubtypes/subtype_hardUnique.js +0 -15
  177. package/lib/types/effects/effectSubtypes/subtype_instant.d.ts +0 -8
  178. package/lib/types/effects/effectSubtypes/subtype_instant.js +0 -20
  179. package/lib/types/effects/effectSubtypes/subtype_once.d.ts +0 -12
  180. package/lib/types/effects/effectSubtypes/subtype_once.js +0 -27
  181. package/lib/types/effects/effectSubtypes/subtype_unique.d.ts +0 -9
  182. package/lib/types/effects/effectSubtypes/subtype_unique.js +0 -16
  183. package/lib/types/effects/effectTypes/initEffect.d.ts +0 -7
  184. package/lib/types/effects/effectTypes/initEffect.js +0 -23
  185. package/lib/types/effects/effectTypes/lockEffect.d.ts +0 -9
  186. package/lib/types/effects/effectTypes/lockEffect.js +0 -25
  187. package/lib/types/effects/effectTypes/manualEffect.d.ts +0 -9
  188. package/lib/types/effects/effectTypes/manualEffect.js +0 -18
  189. package/lib/types/effects/effectTypes/passiveEffect.d.ts +0 -9
  190. package/lib/types/effects/effectTypes/passiveEffect.js +0 -23
  191. package/lib/types/effects/effectTypes/triggerEffect.d.ts +0 -9
  192. package/lib/types/effects/effectTypes/triggerEffect.js +0 -28
  193. package/lib/types/errors/cannotLoad.d.ts +0 -5
  194. package/lib/types/errors/cannotLoad.js +0 -13
  195. package/lib/types/errors/cardNotExist.d.ts +0 -5
  196. package/lib/types/errors/cardNotExist.js +0 -13
  197. package/lib/types/errors/cardNotInApplicableZone.d.ts +0 -5
  198. package/lib/types/errors/cardNotInApplicableZone.js +0 -13
  199. package/lib/types/errors/effectCondNotMet.d.ts +0 -5
  200. package/lib/types/errors/effectCondNotMet.js +0 -13
  201. package/lib/types/errors/effectNotExist.d.ts +0 -5
  202. package/lib/types/errors/effectNotExist.js +0 -13
  203. package/lib/types/errors/error.d.ts +0 -17
  204. package/lib/types/errors/error.js +0 -42
  205. package/lib/types/errors/incorrectActionType.d.ts +0 -5
  206. package/lib/types/errors/incorrectActionType.js +0 -13
  207. package/lib/types/errors/index.d.ts +0 -16
  208. package/lib/types/errors/index.js +0 -36
  209. package/lib/types/errors/invalidOrderMap.d.ts +0 -6
  210. package/lib/types/errors/invalidOrderMap.js +0 -14
  211. package/lib/types/errors/invalidPosition.d.ts +0 -6
  212. package/lib/types/errors/invalidPosition.js +0 -13
  213. package/lib/types/errors/subTypeOverrideConflict.d.ts +0 -7
  214. package/lib/types/errors/subTypeOverrideConflict.js +0 -15
  215. package/lib/types/errors/unknownError.d.ts +0 -5
  216. package/lib/types/errors/unknownError.js +0 -13
  217. package/lib/types/errors/unregisteredAction.d.ts +0 -6
  218. package/lib/types/errors/unregisteredAction.js +0 -13
  219. package/lib/types/errors/wrongEffectIdx.d.ts +0 -5
  220. package/lib/types/errors/wrongEffectIdx.js +0 -14
  221. package/lib/types/errors/zoneAttrConflict.d.ts +0 -5
  222. package/lib/types/errors/zoneAttrConflict.js +0 -15
  223. package/lib/types/errors/zoneFull.d.ts +0 -5
  224. package/lib/types/errors/zoneFull.js +0 -13
  225. package/lib/types/errors/zoneNotExist.d.ts +0 -5
  226. package/lib/types/errors/zoneNotExist.js +0 -13
  227. package/lib/types/misc.d.ts +0 -97
  228. package/lib/types/misc.js +0 -8
  229. package/lib/types/mods/effectTextParserModule.d.ts +0 -16
  230. package/lib/types/mods/effectTextParserModule.js +0 -81
  231. package/lib/types/mods/gameModule.d.ts +0 -5
  232. package/lib/types/mods/gameModule.js +0 -8
  233. package/lib/utils/index.d.ts +0 -78
  234. package/lib/utils/index.js +0 -562
@@ -1,13 +0,0 @@
1
- import type Card from "./card";
2
- import type res from "../generics/universalResponse";
3
- import { Zone } from "./zone";
4
- import Position from "../generics/position";
5
- import { HasTypesArr, Player_specific, Positionable } from "../../misc";
6
- import type { inputData } from "../../../data/systemRegistry";
7
- declare class Zone_stack<T_cull_zone_res extends inputData[] | undefined = undefined, T_cull_interact extends inputData[] | undefined = undefined> extends Zone<T_cull_zone_res, T_cull_interact> {
8
- remove(c: Card): res;
9
- get lastPos(): Position;
10
- isOpposite(c1: Positionable, c2: Positionable): boolean;
11
- isOpposite(z: Player_specific & HasTypesArr): boolean;
12
- }
13
- export default Zone_stack;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- //import position from "./position";
7
- const zone_1 = require("./zone");
8
- const position_1 = __importDefault(require("../generics/position"));
9
- const zoneRegistry_1 = require("../../../data/zoneRegistry");
10
- class Zone_stack extends zone_1.Zone {
11
- // constructor(dataID: string, data?: zoneData){
12
- // super(dataID, data)
13
- // this.cardArr = []
14
- // }
15
- //helper properties
16
- //override get valid(){return this.id >= 0 && this.moveToNeedPosition === false}
17
- //zone functionality functions
18
- //zone has 2 jobs
19
- //1. provides an action if the player wanna do something
20
- //2. perform an action using API/func calls, not action (not enough info)
21
- //functions for step 2
22
- remove(c) {
23
- if (!this.canMoveFrom)
24
- return this.handleNoMoveFrom(c, "remove_stack", 24);
25
- let index = this.findIndex(c.id);
26
- if (index < 0 || !this.cardArr[index] || !this.validatePosition(c.pos))
27
- return this.handleCardNotInApplicableZone(c, "remove_stack", 28);
28
- //slice the last index
29
- this.cardArr.splice(index, 1);
30
- if (c.pos.zoneID == this.id)
31
- c.pos.invalidate();
32
- return [undefined, []];
33
- }
34
- get lastPos() {
35
- return new position_1.default(this.id, this.name, ...Utils.indexToPosition((this.cardArr.length === 0) ? 0 : this.cardArr.length - 1, this.shape));
36
- }
37
- isOpposite(p1, p2) {
38
- if (p2 === undefined) {
39
- const z = p1;
40
- const flag1 = zoneRegistry_1.playerOppositeMap[zoneRegistry_1.playerTypeID[this.playerType]].some(i => i === z.playerType);
41
- const flag2 = this.types.join() === z.types.join();
42
- return flag1 && flag2;
43
- }
44
- else {
45
- const c1 = p1;
46
- const c2 = p2;
47
- return c1.pos.valid &&
48
- c2.pos.valid &&
49
- c1.pos.flat().length === 1 &&
50
- c2.pos.flat().length === 1 &&
51
- c1.pos.x === c2.pos.x;
52
- }
53
- }
54
- }
55
- exports.default = Zone_stack;
@@ -1,23 +0,0 @@
1
- import type { Action } from "../../../_queenSystem/handler/actionGenrator";
2
- declare class _node<Type extends Action = Action> {
3
- data: Type;
4
- completed: boolean;
5
- childArr: _node[];
6
- depth: number;
7
- constructor(a: Type, depth: number, id: number);
8
- get id(): number;
9
- set id(n: number);
10
- get isNormal(): boolean;
11
- get hasChild(): boolean;
12
- get isLeaf(): boolean;
13
- get isRoot(): boolean;
14
- get firstChild(): _node | undefined;
15
- get invalid(): boolean;
16
- invalidate(): void;
17
- markComplete(): void;
18
- attach(id: number, ...a: Action[]): void;
19
- modifySelf(func: (a: Type) => Type): void;
20
- toString(): string;
21
- flat(): Action[];
22
- }
23
- export default _node;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class _node {
4
- constructor(a, depth, id) {
5
- this.completed = false;
6
- this.childArr = [];
7
- this.data = a;
8
- this.depth = depth;
9
- this.id = id;
10
- }
11
- get id() { return this.data.id; }
12
- set id(n) { this.data.assignID(n); }
13
- get isNormal() { return !this.invalid && !this.completed; }
14
- get hasChild() { return this.childArr.length >= 0; }
15
- get isLeaf() { return this.childArr.length == 0; }
16
- get isRoot() { return this.depth == 0; }
17
- get firstChild() { return this.childArr[0]; }
18
- get invalid() { return this.data.isDisabled; }
19
- invalidate() {
20
- this.data.disable();
21
- this.childArr.forEach(i => i.invalidate());
22
- }
23
- markComplete() {
24
- this.completed = true;
25
- }
26
- attach(id, ...a) {
27
- this.childArr.push(...a.map((i, index) => new _node(i, this.depth + 1, id + index)));
28
- }
29
- modifySelf(func) {
30
- this.data = func(this.data);
31
- }
32
- toString() {
33
- let str = "-".repeat(this.depth * 2) + `-> (${this.depth}) ` + JSON.stringify(this.data, null, 0) + "\n";
34
- this.childArr.forEach(i => {
35
- str += i.toString();
36
- });
37
- return str;
38
- }
39
- flat() {
40
- let a = [];
41
- this.childArr.forEach(i => a.push(...i.flat()));
42
- a.push(this.data);
43
- return a;
44
- }
45
- }
46
- exports.default = _node;
@@ -1,23 +0,0 @@
1
- import type { dry_position } from "../../../data/systemRegistry";
2
- declare class Position {
3
- arr: number[];
4
- zoneID: number;
5
- zoneName: string;
6
- get length(): number;
7
- get x(): number;
8
- get y(): number;
9
- get z(): number;
10
- map(func: (value: number, index: number) => number): number[];
11
- forEach(func: (value: number, index: number) => void): void;
12
- flat(): ReadonlyArray<number>;
13
- constructor(zoneID?: number, //runtime ID, NOT data id, the index of the zone in the zone loader
14
- zoneName?: string, ...args: number[]);
15
- constructor(drypos: dry_position);
16
- get valid(): boolean;
17
- invalidate(): void;
18
- toString(): string;
19
- randomizeSelf(pArr: Position[]): void;
20
- randomizeSelf(max: number, min: number): void;
21
- is(pos: dry_position): boolean;
22
- }
23
- export default Position;
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class Position {
4
- get length() { return this.arr.length; }
5
- get x() {
6
- var _a;
7
- return (_a = this.arr[0]) !== null && _a !== void 0 ? _a : 0;
8
- }
9
- get y() {
10
- var _a;
11
- return (_a = this.arr[1]) !== null && _a !== void 0 ? _a : -1;
12
- }
13
- get z() {
14
- var _a;
15
- return (_a = this.arr[2]) !== null && _a !== void 0 ? _a : -1;
16
- }
17
- map(func) {
18
- return this.arr.map(func);
19
- }
20
- forEach(func) {
21
- this.arr.forEach(func);
22
- }
23
- flat() { return this.arr; }
24
- constructor(param1 = -1, zoneName = "unknown", ...args) {
25
- this.arr = [];
26
- if (typeof param1 == "number") {
27
- this.zoneID = param1;
28
- this.zoneName = zoneName;
29
- this.arr = args;
30
- }
31
- else {
32
- this.zoneID = param1.zoneID;
33
- this.zoneName = param1.zoneName,
34
- this.arr = param1.flat().slice();
35
- }
36
- }
37
- get valid() {
38
- if (this.zoneID < 0)
39
- return false;
40
- if (!this.length)
41
- return false;
42
- this.arr.forEach(i => {
43
- if (i < 0)
44
- return false;
45
- });
46
- return true;
47
- }
48
- invalidate() {
49
- this.zoneID = -1;
50
- this.zoneName = "unknown";
51
- this.arr = new Array(this.length).fill(-1);
52
- }
53
- toString() {
54
- if (this.valid)
55
- return `[${this.zoneName}, ${(this.length == 1) ? this.arr[0] :
56
- this.arr.join(", ")}]`;
57
- return `[Invalid pos]`;
58
- }
59
- randomizeSelf(param1, param2 = 0) {
60
- if (typeof param1 == 'number') {
61
- //overload 2
62
- let max = param1;
63
- let min = param2;
64
- for (let i = 0; i < this.length; i++) {
65
- this.arr[i] = Utils.rng(max, min, true);
66
- }
67
- }
68
- else {
69
- //overload 1
70
- let max = param1.length;
71
- let min = 0;
72
- let i = Utils.rng(max, min, true);
73
- this.arr = param1[i].arr;
74
- this.zoneID = param1[i].zoneID;
75
- }
76
- }
77
- is(pos) {
78
- if (Object.is(this, pos))
79
- return true;
80
- if (pos.zoneID !== this.zoneID)
81
- return false;
82
- if (this.arr.length !== pos.flat().length)
83
- return false;
84
- for (let i = 0; i < this.arr.length; i++) {
85
- if (this.arr[i] !== pos.flat()[i])
86
- return false;
87
- }
88
- return true;
89
- }
90
- }
91
- exports.default = Position;
@@ -1,25 +0,0 @@
1
- import _node from "./node";
2
- import type { Action } from "../../../_queenSystem/handler/actionGenrator";
3
- declare class _tree<RootType extends Action> {
4
- length: number;
5
- root: _node<RootType>;
6
- constructor(a: RootType);
7
- toString(): string;
8
- protected handleNode(func: (node: _node) => void, node?: _node, ...data: any[]): boolean;
9
- attach(...data: Action[]): void;
10
- attach_node(n: _node, ...data: Action[]): void;
11
- modify(func: (a: Action) => Action): boolean;
12
- flat(): import("../../../_queenSystem/handler/actionGenrator").Action_class<import("../../../data/systemRegistry").identificationInfo[], any, any>[];
13
- invalidate(): boolean;
14
- getNormal(node?: _node): Action | undefined;
15
- protected handleNodeWithID(nodeID: number, func: (node: _node) => void, node?: _node, ...data: any[]): boolean;
16
- IDValid(nodeID: number): boolean;
17
- attachArbitrary(nodeID: number, ...data: Action[]): boolean;
18
- modifyArbitrary(nodeID: number, func: (a: Action) => Action): boolean;
19
- invalidateArbitrary(nodeID: number): boolean;
20
- recurAll(func: (a: _node) => boolean, stopID?: number): void;
21
- getNode(id: number): _node<import("../../../_queenSystem/handler/actionGenrator").Action_class<import("../../../data/systemRegistry").identificationInfo[], any, any>>;
22
- getNext(): _node | undefined;
23
- clear(): void;
24
- }
25
- export default _tree;
@@ -1,153 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_1 = __importDefault(require("./node"));
7
- class _tree {
8
- constructor(a) {
9
- this.length = 0;
10
- this.root = new node_1.default(a, 0, this.length);
11
- this.length++;
12
- }
13
- toString() {
14
- return "\n" + this.root.toString();
15
- }
16
- // all operations below are operated on the lowest left most NORMAL node
17
- // protected handleNode(func : (a : _node<T>) => void, node : _node<T> | undefined, ...data : any[]) : void{
18
- // if(!node) return
19
- // if(node.isLeaf) return func(node)
20
- // return this.handleNode(func, node.firstChild, ...data)
21
- // }
22
- handleNode(func, node = this.root, ...data) {
23
- if (!node)
24
- return false;
25
- for (let i = 0; i < node.childArr.length; i++) {
26
- let child = node.childArr[i];
27
- if (this.handleNode(func, child, ...data))
28
- return true;
29
- }
30
- if (node.isNormal) {
31
- func(node);
32
- return true;
33
- }
34
- return false;
35
- }
36
- attach(...data) {
37
- this.handleNode((n) => {
38
- return n.attach(this.length, ...data);
39
- }, this.root, ...data);
40
- this.length += data.length;
41
- }
42
- attach_node(n, ...data) {
43
- n.attach(this.length, ...data);
44
- this.length += data.length;
45
- }
46
- modify(func) {
47
- return this.handleNode((n) => {
48
- return n.modifySelf(func);
49
- }, this.root, func);
50
- }
51
- // get(node = this.root, errorValue : T = this.root.data) : T{
52
- // if(!node) return errorValue
53
- // if(node.isLeaf) return node.data
54
- // return this.get(node.firstChild, errorValue)
55
- // }
56
- flat() {
57
- return this.root.flat();
58
- }
59
- invalidate() {
60
- return this.handleNode((n) => {
61
- return n.invalidate();
62
- }, this.root);
63
- }
64
- // traversePostOrder(node: _node<T> = this.root, func : (n : _node<T>) => void): void {
65
- // if (!node) return;
66
- // node.childArr.forEach(child => this.traversePostOrder(child, func));
67
- // console.log(node.data);
68
- // }
69
- getNormal(node = this.root) {
70
- if (!node)
71
- return undefined;
72
- for (let child of node.childArr) {
73
- let result = this.getNormal(child);
74
- if (result !== undefined)
75
- return result;
76
- }
77
- if (node.isNormal)
78
- return node.data;
79
- return undefined;
80
- }
81
- //archaic methods
82
- handleNodeWithID(nodeID, func, node = this.root, ...data) {
83
- if (!this.IDValid(nodeID))
84
- return false;
85
- if (!node)
86
- return false;
87
- for (let child of node.childArr) {
88
- if (this.handleNodeWithID(nodeID, func, child, ...data))
89
- return true;
90
- }
91
- if (node.id == nodeID) {
92
- func(node);
93
- return true;
94
- }
95
- return false;
96
- }
97
- IDValid(nodeID) {
98
- return nodeID >= 0 && nodeID < this.length;
99
- }
100
- attachArbitrary(nodeID, ...data) {
101
- if (!data.length)
102
- return false;
103
- let a = this.handleNodeWithID(nodeID, (n) => {
104
- return n.attach(this.length, ...data);
105
- }, this.root, ...data);
106
- if (a)
107
- this.length += data.length;
108
- return a;
109
- }
110
- modifyArbitrary(nodeID, func) {
111
- return this.handleNodeWithID(nodeID, (n) => {
112
- return n.modifySelf(func);
113
- }, this.root, func);
114
- }
115
- invalidateArbitrary(nodeID) {
116
- return this.handleNodeWithID(nodeID, (n) => {
117
- return n.invalidate();
118
- }, this.root);
119
- }
120
- recurAll(func, stopID) {
121
- let flag = false;
122
- this.handleNode((n) => {
123
- if (n.id === stopID) {
124
- flag = true;
125
- return;
126
- }
127
- flag = func(n);
128
- //n.markComplete()
129
- }, this.root);
130
- if (this.root.isNormal && !flag)
131
- this.recurAll(func, stopID);
132
- }
133
- //added, kinda danerous since now outsider have access to node pointers
134
- getNode(id) {
135
- let n = this.root;
136
- this.handleNodeWithID(id, (k) => {
137
- n = k;
138
- });
139
- return n;
140
- }
141
- getNext() {
142
- let n = undefined;
143
- this.handleNode((k) => {
144
- n = k;
145
- });
146
- return n;
147
- }
148
- clear() {
149
- //keeps the root
150
- this.root.childArr = [];
151
- }
152
- }
153
- exports.default = _tree;
@@ -1,4 +0,0 @@
1
- import type error from "../../errors/error";
2
- import type { Action } from "../../../_queenSystem/handler/actionGenrator";
3
- type res = [error, undefined] | [undefined, Action[]];
4
- export default res;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
1
- export declare class Valueable<T> {
2
- get value(): T;
3
- extends<R>(f: (p: T) => R, thisParam?: any): Valueable<R>;
4
- }
5
- export declare class Volatile<ParamType extends any[], resultType extends any> extends Valueable<resultType> {
6
- private __params;
7
- private __f;
8
- constructor(f: (...p: ParamType) => resultType, __params: ParamType, ThisParam?: any);
9
- get value(): resultType;
10
- extends<R extends unknown>(f: (p: resultType) => R, thisParam?: any): Valueable<R>;
11
- }
12
- export declare class Lazy<ParamType extends any[], resultType extends any> extends Valueable<resultType> {
13
- private __params;
14
- private __f;
15
- private __cache;
16
- private __resolved;
17
- get resolved(): boolean;
18
- constructor(f: (...p: ParamType) => resultType, __params: ParamType, ThisParam?: any);
19
- get value(): resultType;
20
- extends<R extends unknown>(f: (p: resultType) => R, thisParam?: any): Valueable<R>;
21
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Lazy = exports.Volatile = exports.Valueable = void 0;
4
- class Valueable {
5
- get value() {
6
- throw new Error("Not Implemented");
7
- }
8
- extends(f, thisParam) {
9
- throw new Error("not Implemented");
10
- }
11
- }
12
- exports.Valueable = Valueable;
13
- class Volatile extends Valueable {
14
- constructor(f, __params, ThisParam) {
15
- super();
16
- this.__params = __params;
17
- this.__f = f.bind(ThisParam);
18
- }
19
- get value() {
20
- return this.__f(...this.__params);
21
- }
22
- extends(f, thisParam) {
23
- //Magic wizardry shit
24
- //replace a funtion with a new function that calls the old one
25
- function f2(oldf) {
26
- return (...params) => f.bind(thisParam)(oldf(...params));
27
- }
28
- this.__f = f2(this.__f);
29
- return this;
30
- }
31
- }
32
- exports.Volatile = Volatile;
33
- class Lazy extends Valueable {
34
- get resolved() { return this.__resolved; }
35
- constructor(f, __params, ThisParam) {
36
- super();
37
- this.__params = __params;
38
- this.__resolved = false;
39
- this.__f = f.bind(ThisParam);
40
- }
41
- get value() {
42
- if (this.__resolved)
43
- return this.__cache;
44
- this.__cache = this.__f(...this.__params);
45
- this.__resolved = true;
46
- return this.__cache;
47
- }
48
- extends(f, thisParam) {
49
- function f2(oldf) {
50
- return (...params) => f.bind(thisParam)(oldf(...params));
51
- }
52
- this.__f = f2(this.__f);
53
- return this;
54
- }
55
- }
56
- exports.Lazy = Lazy;
@@ -1,88 +0,0 @@
1
- export declare enum iconID {
2
- "arrowUp" = 0,
3
- "arrowDown" = 1,
4
- "arrowLeft" = 2,
5
- "arrowRight" = 3,
6
- "doubleArrowDown" = 10,
7
- "doubleArrowUp" = 11,
8
- "doubleArrowLeft" = 12,
9
- "doubleArrowRight" = 13,
10
- "bonded" = 100,//cannot be deleted, duplicated or moved
11
- "cached" = 101,
12
- "chain" = 102,
13
- "consumable" = 103,
14
- "death" = 104,//on death trigger
15
- "defense" = 105,//reduce or prevent damage
16
- "dragoonLink" = 106,
17
- "effect_condition" = 107,//lock
18
- "exclusive" = 108,//unused
19
- "execute" = 109,
20
- "hardUnique" = 110,
21
- "init" = 111,
22
- "instant" = 112,
23
- "lock" = 113,
24
- "manual" = 114,
25
- "once" = 115,
26
- "passive" = 116,
27
- "preload" = 117,
28
- "trigger" = 118,
29
- "unique" = 119,
30
- "void" = 120,//void this card on some condition
31
- "dmg_magic" = 200,
32
- "dmg_phys" = 201,
33
- "crash" = 1000,//image thats shows when player die, kinda bad ngl
34
- "loot" = 1001,//the icon of the loot, show for cards that can gain you loots or check for them
35
- "player_health" = 1002
36
- }
37
- export declare enum componentID {
38
- error = -1,
39
- number = 1,
40
- text = 2,
41
- image = 3,
42
- reference = 4,
43
- symbol = 5
44
- }
45
- export type specificComponent<T extends keyof typeof componentID> = {
46
- error: DisplayComponent;
47
- number: NumberComponent;
48
- text: TextComponent;
49
- image: ImageComponent;
50
- reference: ReferenceComponent;
51
- symbol: SymbolComponent;
52
- }[T];
53
- export declare class DisplayComponent {
54
- id: componentID;
55
- errorFlag: boolean;
56
- errorMsg: string;
57
- sectionIDs: string[];
58
- fromCmd: string;
59
- raw: string;
60
- constructor(id?: componentID, errMsg?: string, fromCmd?: string, raw?: string);
61
- addSectionID(newID: string | string[]): this;
62
- is<T extends keyof typeof componentID>(id: T): this is specificComponent<T>;
63
- }
64
- export declare class TextComponent extends DisplayComponent {
65
- str: string;
66
- private num;
67
- constructor(str: string, errMsg?: string, fromCmd?: string, raw?: string);
68
- }
69
- export declare class NumberComponent extends DisplayComponent {
70
- num: number;
71
- constructor(num: number, errMsg?: string, fromCmd?: string, raw?: string);
72
- }
73
- export declare class ImageComponent extends DisplayComponent {
74
- url: string;
75
- constructor(url: string, errMsg?: string, fromCmd?: string, raw?: string);
76
- }
77
- export declare class IconComponent extends ImageComponent {
78
- iconID: iconID;
79
- constructor(id: iconID, errMsg?: string, fromCmd?: string, raw?: string);
80
- }
81
- export declare class ReferenceComponent extends DisplayComponent {
82
- readonly ref: any;
83
- constructor(ref: any, errMsg?: string, fromCmd?: string, raw?: string);
84
- }
85
- export declare class SymbolComponent extends DisplayComponent {
86
- readonly symbolID: string;
87
- constructor(id: string, errMsg?: string, fromCmd?: string, raw?: string);
88
- }