qpremake 1.5.1
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 +184 -0
- package/lib/_localizationFiles/English.d.ts +2 -0
- package/lib/_localizationFiles/English.js +307 -0
- package/lib/_mods/parserModules/addSymbol.d.ts +7 -0
- package/lib/_mods/parserModules/addSymbol.js +18 -0
- package/lib/_mods/parserModules/expression.d.ts +7 -0
- package/lib/_mods/parserModules/expression.js +45 -0
- package/lib/_mods/parserModules/expression_parser.d.ts +143 -0
- package/lib/_mods/parserModules/expression_parser.js +728 -0
- package/lib/_mods/parserModules/img.d.ts +8 -0
- package/lib/_mods/parserModules/img.js +42 -0
- package/lib/_mods/parserModules/qpOriginal.d.ts +5 -0
- package/lib/_mods/parserModules/qpOriginal.js +27 -0
- package/lib/_mods/parserModules/sectionID.d.ts +13 -0
- package/lib/_mods/parserModules/sectionID.js +56 -0
- package/lib/_mods/parserModules/tags.d.ts +9 -0
- package/lib/_mods/parserModules/tags.js +29 -0
- package/lib/_mods/parserModules/uaddminus.d.ts +9 -0
- package/lib/_mods/parserModules/uaddminus.js +42 -0
- package/lib/_mods/parserModules/variantCheck.d.ts +10 -0
- package/lib/_mods/parserModules/variantCheck.js +53 -0
- package/lib/_queenSystem/handler/actionGenrator.d.ts +994 -0
- package/lib/_queenSystem/handler/actionGenrator.js +646 -0
- package/lib/_queenSystem/handler/actionInputGenerator.d.ts +95 -0
- package/lib/_queenSystem/handler/actionInputGenerator.js +373 -0
- package/lib/_queenSystem/handler/actionInputRequesterGenerator.d.ts +92 -0
- package/lib/_queenSystem/handler/actionInputRequesterGenerator.js +341 -0
- package/lib/_queenSystem/handler/cardHandler.d.ts +20 -0
- package/lib/_queenSystem/handler/cardHandler.js +61 -0
- package/lib/_queenSystem/handler/effectGenerator.d.ts +1 -0
- package/lib/_queenSystem/handler/effectGenerator.js +127 -0
- package/lib/_queenSystem/handler/localizationHandler.d.ts +28 -0
- package/lib/_queenSystem/handler/localizationHandler.js +166 -0
- package/lib/_queenSystem/handler/modHandler.d.ts +10 -0
- package/lib/_queenSystem/handler/modHandler.js +36 -0
- package/lib/_queenSystem/handler/oldDataProcessor.d.ts +9 -0
- package/lib/_queenSystem/handler/oldDataProcessor.js +129 -0
- package/lib/_queenSystem/handler/registryHandler.d.ts +36 -0
- package/lib/_queenSystem/handler/registryHandler.js +63 -0
- package/lib/_queenSystem/handler/zoneHandler.d.ts +102 -0
- package/lib/_queenSystem/handler/zoneHandler.js +606 -0
- package/lib/_queenSystem/loader/loader_card.d.ts +20 -0
- package/lib/_queenSystem/loader/loader_card.js +124 -0
- package/lib/_queenSystem/loader/loader_effect.d.ts +27 -0
- package/lib/_queenSystem/loader/loader_effect.js +163 -0
- package/lib/_queenSystem/loader/loader_handler.d.ts +11 -0
- package/lib/_queenSystem/loader/loader_handler.js +24 -0
- package/lib/_queenSystem/loader/loader_localization.d.ts +11 -0
- package/lib/_queenSystem/loader/loader_localization.js +73 -0
- package/lib/_queenSystem/loader/loader_mod.d.ts +10 -0
- package/lib/_queenSystem/loader/loader_mod.js +72 -0
- package/lib/_queenSystem/loader/loader_subtype.d.ts +9 -0
- package/lib/_queenSystem/loader/loader_subtype.js +39 -0
- package/lib/_queenSystem/loader/loader_type.d.ts +9 -0
- package/lib/_queenSystem/loader/loader_type.js +39 -0
- package/lib/_queenSystem/loader/loader_zone.d.ts +14 -0
- package/lib/_queenSystem/loader/loader_zone.js +35 -0
- package/lib/_queenSystem/queenSystem.d.ts +127 -0
- package/lib/_queenSystem/queenSystem.js +996 -0
- package/lib/_queenSystem/renderer/rendererInterface.d.ts +9 -0
- package/lib/_queenSystem/renderer/rendererInterface.js +2 -0
- package/lib/data/actionRegistry.d.ts +56 -0
- package/lib/data/actionRegistry.js +60 -0
- package/lib/data/cardRegistry.d.ts +1162 -0
- package/lib/data/cardRegistry.js +716 -0
- package/lib/data/deckRegistry.d.ts +19 -0
- package/lib/data/deckRegistry.js +41 -0
- package/lib/data/effectRegistry.d.ts +465 -0
- package/lib/data/effectRegistry.js +151 -0
- package/lib/data/effectTypeRegistry.d.ts +14 -0
- package/lib/data/effectTypeRegistry.js +14 -0
- package/lib/data/operatorRegistry.d.ts +92 -0
- package/lib/data/operatorRegistry.js +82 -0
- package/lib/data/rarityRegistry.d.ts +28 -0
- package/lib/data/rarityRegistry.js +63 -0
- package/lib/data/registryRegistry.d.ts +10 -0
- package/lib/data/registryRegistry.js +14 -0
- package/lib/data/subtypeRegistry.d.ts +15 -0
- package/lib/data/subtypeRegistry.js +15 -0
- package/lib/data/systemRegistry.d.ts +253 -0
- package/lib/data/systemRegistry.js +56 -0
- package/lib/data/zoneRegistry.d.ts +43 -0
- package/lib/data/zoneRegistry.js +157 -0
- package/lib/effectTextParser/index.d.ts +42 -0
- package/lib/effectTextParser/index.js +316 -0
- package/lib/global/index.d.ts +8 -0
- package/lib/global/index.js +12 -0
- package/lib/index.d.ts +6344 -0
- package/lib/index.js +213 -0
- package/lib/specificEffects/e_cond.d.ts +11 -0
- package/lib/specificEffects/e_cond.js +36 -0
- package/lib/specificEffects/e_fruit.d.ts +3 -0
- package/lib/specificEffects/e_fruit.js +187 -0
- package/lib/specificEffects/e_generic.d.ts +191 -0
- package/lib/specificEffects/e_generic.js +662 -0
- package/lib/specificEffects/e_generic_cardTargetting.d.ts +38 -0
- package/lib/specificEffects/e_generic_cardTargetting.js +82 -0
- package/lib/specificEffects/e_generic_noneTargetting.d.ts +10 -0
- package/lib/specificEffects/e_generic_noneTargetting.js +26 -0
- package/lib/specificEffects/e_status.d.ts +80 -0
- package/lib/specificEffects/e_status.js +151 -0
- package/lib/specificEffects/e_test.d.ts +3 -0
- package/lib/specificEffects/e_test.js +21 -0
- package/lib/types/abstract/gameComponents/API.d.ts +19 -0
- package/lib/types/abstract/gameComponents/API.js +2 -0
- package/lib/types/abstract/gameComponents/card.d.ts +108 -0
- package/lib/types/abstract/gameComponents/card.js +771 -0
- package/lib/types/abstract/gameComponents/effect.d.ts +82 -0
- package/lib/types/abstract/gameComponents/effect.js +331 -0
- package/lib/types/abstract/gameComponents/effectSubtype.d.ts +22 -0
- package/lib/types/abstract/gameComponents/effectSubtype.js +40 -0
- package/lib/types/abstract/gameComponents/effectType.d.ts +11 -0
- package/lib/types/abstract/gameComponents/effectType.js +8 -0
- package/lib/types/abstract/gameComponents/settings.d.ts +80 -0
- package/lib/types/abstract/gameComponents/settings.js +68 -0
- package/lib/types/abstract/gameComponents/zone.d.ts +113 -0
- package/lib/types/abstract/gameComponents/zone.js +614 -0
- package/lib/types/abstract/gameComponents/zone_gridBased.d.ts +18 -0
- package/lib/types/abstract/gameComponents/zone_gridBased.js +58 -0
- package/lib/types/abstract/gameComponents/zone_stackBased.d.ts +13 -0
- package/lib/types/abstract/gameComponents/zone_stackBased.js +55 -0
- package/lib/types/abstract/generics/node.d.ts +23 -0
- package/lib/types/abstract/generics/node.js +46 -0
- package/lib/types/abstract/generics/position.d.ts +23 -0
- package/lib/types/abstract/generics/position.js +91 -0
- package/lib/types/abstract/generics/tree.d.ts +25 -0
- package/lib/types/abstract/generics/tree.js +153 -0
- package/lib/types/abstract/generics/universalResponse.d.ts +4 -0
- package/lib/types/abstract/generics/universalResponse.js +2 -0
- package/lib/types/abstract/generics/wraper.d.ts +21 -0
- package/lib/types/abstract/generics/wraper.js +56 -0
- package/lib/types/abstract/parser/component.d.ts +88 -0
- package/lib/types/abstract/parser/component.js +132 -0
- package/lib/types/abstract/parser/index.d.ts +6 -0
- package/lib/types/abstract/parser/index.js +28 -0
- package/lib/types/abstract/parser/modPack.d.ts +21 -0
- package/lib/types/abstract/parser/modPack.js +48 -0
- package/lib/types/abstract/parser/moduleInputObject.d.ts +12 -0
- package/lib/types/abstract/parser/moduleInputObject.js +21 -0
- package/lib/types/abstract/parser/options.d.ts +31 -0
- package/lib/types/abstract/parser/options.js +45 -0
- package/lib/types/abstract/serializedGameComponents/Gamestate.d.ts +46 -0
- package/lib/types/abstract/serializedGameComponents/Gamestate.js +70 -0
- package/lib/types/abstract/serializedGameComponents/Localized.d.ts +69 -0
- package/lib/types/abstract/serializedGameComponents/Localized.js +84 -0
- package/lib/types/defaultZones/ability.d.ts +10 -0
- package/lib/types/defaultZones/ability.js +22 -0
- package/lib/types/defaultZones/deck.d.ts +25 -0
- package/lib/types/defaultZones/deck.js +90 -0
- package/lib/types/defaultZones/drop.d.ts +5 -0
- package/lib/types/defaultZones/drop.js +13 -0
- package/lib/types/defaultZones/field.d.ts +11 -0
- package/lib/types/defaultZones/field.js +35 -0
- package/lib/types/defaultZones/grave.d.ts +8 -0
- package/lib/types/defaultZones/grave.js +21 -0
- package/lib/types/defaultZones/hand.d.ts +5 -0
- package/lib/types/defaultZones/hand.js +14 -0
- package/lib/types/defaultZones/storage.d.ts +9 -0
- package/lib/types/defaultZones/storage.js +21 -0
- package/lib/types/defaultZones/system.d.ts +12 -0
- package/lib/types/defaultZones/system.js +35 -0
- package/lib/types/defaultZones/void.d.ts +4 -0
- package/lib/types/defaultZones/void.js +10 -0
- package/lib/types/effects/effectSubtypes/subtype_chained.d.ts +10 -0
- package/lib/types/effects/effectSubtypes/subtype_chained.js +17 -0
- package/lib/types/effects/effectSubtypes/subtype_delayed.d.ts +9 -0
- package/lib/types/effects/effectSubtypes/subtype_delayed.js +16 -0
- package/lib/types/effects/effectSubtypes/subtype_fieldLock.d.ts +9 -0
- package/lib/types/effects/effectSubtypes/subtype_fieldLock.js +21 -0
- package/lib/types/effects/effectSubtypes/subtype_graveLock.d.ts +9 -0
- package/lib/types/effects/effectSubtypes/subtype_graveLock.js +21 -0
- package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.d.ts +9 -0
- package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.js +21 -0
- package/lib/types/effects/effectSubtypes/subtype_hardUnique.d.ts +9 -0
- package/lib/types/effects/effectSubtypes/subtype_hardUnique.js +15 -0
- package/lib/types/effects/effectSubtypes/subtype_instant.d.ts +8 -0
- package/lib/types/effects/effectSubtypes/subtype_instant.js +20 -0
- package/lib/types/effects/effectSubtypes/subtype_once.d.ts +12 -0
- package/lib/types/effects/effectSubtypes/subtype_once.js +27 -0
- package/lib/types/effects/effectSubtypes/subtype_unique.d.ts +9 -0
- package/lib/types/effects/effectSubtypes/subtype_unique.js +16 -0
- package/lib/types/effects/effectTypes/initEffect.d.ts +7 -0
- package/lib/types/effects/effectTypes/initEffect.js +23 -0
- package/lib/types/effects/effectTypes/lockEffect.d.ts +9 -0
- package/lib/types/effects/effectTypes/lockEffect.js +25 -0
- package/lib/types/effects/effectTypes/manualEffect.d.ts +9 -0
- package/lib/types/effects/effectTypes/manualEffect.js +18 -0
- package/lib/types/effects/effectTypes/passiveEffect.d.ts +9 -0
- package/lib/types/effects/effectTypes/passiveEffect.js +23 -0
- package/lib/types/effects/effectTypes/triggerEffect.d.ts +9 -0
- package/lib/types/effects/effectTypes/triggerEffect.js +28 -0
- package/lib/types/errors/cannotLoad.d.ts +5 -0
- package/lib/types/errors/cannotLoad.js +13 -0
- package/lib/types/errors/cardNotExist.d.ts +5 -0
- package/lib/types/errors/cardNotExist.js +13 -0
- package/lib/types/errors/cardNotInApplicableZone.d.ts +5 -0
- package/lib/types/errors/cardNotInApplicableZone.js +13 -0
- package/lib/types/errors/effectCondNotMet.d.ts +5 -0
- package/lib/types/errors/effectCondNotMet.js +13 -0
- package/lib/types/errors/effectNotExist.d.ts +5 -0
- package/lib/types/errors/effectNotExist.js +13 -0
- package/lib/types/errors/error.d.ts +17 -0
- package/lib/types/errors/error.js +42 -0
- package/lib/types/errors/incorrectActionType.d.ts +5 -0
- package/lib/types/errors/incorrectActionType.js +13 -0
- package/lib/types/errors/index.d.ts +16 -0
- package/lib/types/errors/index.js +36 -0
- package/lib/types/errors/invalidOrderMap.d.ts +6 -0
- package/lib/types/errors/invalidOrderMap.js +14 -0
- package/lib/types/errors/invalidPosition.d.ts +6 -0
- package/lib/types/errors/invalidPosition.js +13 -0
- package/lib/types/errors/subTypeOverrideConflict.d.ts +7 -0
- package/lib/types/errors/subTypeOverrideConflict.js +15 -0
- package/lib/types/errors/unknownError.d.ts +5 -0
- package/lib/types/errors/unknownError.js +13 -0
- package/lib/types/errors/unregisteredAction.d.ts +6 -0
- package/lib/types/errors/unregisteredAction.js +13 -0
- package/lib/types/errors/wrongEffectIdx.d.ts +5 -0
- package/lib/types/errors/wrongEffectIdx.js +14 -0
- package/lib/types/errors/zoneAttrConflict.d.ts +5 -0
- package/lib/types/errors/zoneAttrConflict.js +15 -0
- package/lib/types/errors/zoneFull.d.ts +5 -0
- package/lib/types/errors/zoneFull.js +13 -0
- package/lib/types/errors/zoneNotExist.d.ts +5 -0
- package/lib/types/errors/zoneNotExist.js +13 -0
- package/lib/types/misc.d.ts +97 -0
- package/lib/types/misc.js +8 -0
- package/lib/types/mods/effectTextParserModule.d.ts +16 -0
- package/lib/types/mods/effectTextParserModule.js +81 -0
- package/lib/types/mods/gameModule.d.ts +5 -0
- package/lib/types/mods/gameModule.js +8 -0
- package/lib/utils/index.d.ts +78 -0
- package/lib/utils/index.js +562 -0
- package/package.json +45 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DisplayComponent, ParserModule, moduleInputObject, parseOptions } from '../../types/abstract/parser';
|
|
2
|
+
export default class imgModule extends ParserModule {
|
|
3
|
+
cmdName: string[];
|
|
4
|
+
requiredAttr: never[][];
|
|
5
|
+
doCheckRequiredAttr: boolean;
|
|
6
|
+
private getIconID;
|
|
7
|
+
evaluate(cmd: string, args: moduleInputObject, option: parseOptions, raw: string): DisplayComponent[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parser_1 = require("../../types/abstract/parser");
|
|
4
|
+
class imgModule extends parser_1.ParserModule {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.cmdName = ['img', 'icon'];
|
|
8
|
+
this.requiredAttr = [[], []];
|
|
9
|
+
this.doCheckRequiredAttr = false;
|
|
10
|
+
}
|
|
11
|
+
getIconID(key) {
|
|
12
|
+
let k = key;
|
|
13
|
+
let x = parser_1.iconID[k];
|
|
14
|
+
if (!x)
|
|
15
|
+
return [parser_1.iconID.crash, false];
|
|
16
|
+
return [x, true];
|
|
17
|
+
}
|
|
18
|
+
evaluate(cmd, args, option, raw) {
|
|
19
|
+
let isInIconMode = false;
|
|
20
|
+
let str = args.getAttr('id');
|
|
21
|
+
if (str)
|
|
22
|
+
isInIconMode = true;
|
|
23
|
+
else
|
|
24
|
+
str = args.getAttr('url');
|
|
25
|
+
if (str)
|
|
26
|
+
isInIconMode = false;
|
|
27
|
+
else
|
|
28
|
+
return [];
|
|
29
|
+
if (isInIconMode) {
|
|
30
|
+
let [iconID, isCorrect] = this.getIconID(str);
|
|
31
|
+
return [
|
|
32
|
+
new parser_1.IconComponent(iconID, isCorrect ? undefined : `Wrong iconID, received = ${str}`, cmd, raw)
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return [
|
|
37
|
+
new parser_1.ImageComponent(str, undefined, cmd, raw)
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = imgModule;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 expression_1 = __importDefault(require("./expression"));
|
|
7
|
+
const img_1 = __importDefault(require("./img"));
|
|
8
|
+
const sectionID_1 = __importDefault(require("./sectionID"));
|
|
9
|
+
const tags_1 = __importDefault(require("./tags"));
|
|
10
|
+
const uaddminus_1 = __importDefault(require("./uaddminus"));
|
|
11
|
+
const variantCheck_1 = __importDefault(require("./variantCheck"));
|
|
12
|
+
const parser_1 = require("../../types/abstract/parser");
|
|
13
|
+
class qpOriginalPack extends parser_1.modPack {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.moduleArr = [
|
|
17
|
+
new img_1.default(),
|
|
18
|
+
new sectionID_1.default(),
|
|
19
|
+
new uaddminus_1.default(),
|
|
20
|
+
new variantCheck_1.default(),
|
|
21
|
+
new tags_1.default(),
|
|
22
|
+
new expression_1.default(),
|
|
23
|
+
];
|
|
24
|
+
this.loadModules();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = qpOriginalPack;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DisplayComponent, ParserModule, moduleInputObject, parseOptions } from '../../types/abstract/parser';
|
|
2
|
+
import type { nestedTree } from '../../types/misc';
|
|
3
|
+
export default class sectionIDModule extends ParserModule {
|
|
4
|
+
private quickKeyword;
|
|
5
|
+
private normalKeyword;
|
|
6
|
+
private pastKeyword;
|
|
7
|
+
private colorKeyword;
|
|
8
|
+
cmdName: string[];
|
|
9
|
+
requiredAttr: any[];
|
|
10
|
+
doCheckRequiredAttr: boolean;
|
|
11
|
+
private recurModify;
|
|
12
|
+
evaluate(cmd: string, args: moduleInputObject, option: parseOptions, raw: string): nestedTree<DisplayComponent>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parser_1 = require("../../types/abstract/parser");
|
|
4
|
+
class sectionIDModule extends parser_1.ParserModule {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.quickKeyword = ['void', 'decompile', 'pathed', 'exposed', 'exec', 'align', 'cover', 'suspend', 'automate'];
|
|
8
|
+
this.normalKeyword = ['key', 'physical', 'magic', 'health', 'attack', 'specialbuff'];
|
|
9
|
+
this.pastKeyword = ['decompiled', 'exec-ed', 'aligned'];
|
|
10
|
+
this.colorKeyword = ['red', 'green', 'blue', 'white', 'black', 'yellow', 'orange', 'purple'];
|
|
11
|
+
this.cmdName = [
|
|
12
|
+
...this.normalKeyword,
|
|
13
|
+
...this.pastKeyword,
|
|
14
|
+
...this.quickKeyword,
|
|
15
|
+
...this.colorKeyword,
|
|
16
|
+
'physical2', 'magic2',
|
|
17
|
+
];
|
|
18
|
+
this.requiredAttr = new Array(this.cmdName.length).fill([]);
|
|
19
|
+
this.doCheckRequiredAttr = false;
|
|
20
|
+
}
|
|
21
|
+
recurModify(tree, sectionID, upperCase) {
|
|
22
|
+
tree.forEach(i => {
|
|
23
|
+
if (i instanceof parser_1.DisplayComponent) {
|
|
24
|
+
i.addSectionID(sectionID);
|
|
25
|
+
if (i.id == parser_1.componentID.text && upperCase) {
|
|
26
|
+
i.str = i.str.toUpperCase();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.recurModify(i, sectionID, upperCase);
|
|
31
|
+
}
|
|
32
|
+
;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
evaluate(cmd, args, option, raw) {
|
|
36
|
+
let quickFlag = this.quickKeyword.includes(cmd);
|
|
37
|
+
let addIconFlag = cmd.endsWith('2');
|
|
38
|
+
let x = cmd;
|
|
39
|
+
if (addIconFlag)
|
|
40
|
+
x = x.slice(0, -1);
|
|
41
|
+
let final = args.getChilren();
|
|
42
|
+
if (quickFlag && !final.length) {
|
|
43
|
+
//special behavior
|
|
44
|
+
// x = x.toLowerCase()
|
|
45
|
+
return [
|
|
46
|
+
new parser_1.SymbolComponent("key_" + x, undefined, cmd, raw)
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
this.recurModify(final, x, quickFlag);
|
|
50
|
+
if (addIconFlag) {
|
|
51
|
+
final = [final, [new parser_1.IconComponent((x == "physical") ? parser_1.iconID.dmg_phys : parser_1.iconID.dmg_magic, undefined, cmd, raw)]];
|
|
52
|
+
}
|
|
53
|
+
return final;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = sectionIDModule;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DisplayComponent, ParserModule, moduleInputObject, parseOptions } from '../../types/abstract/parser';
|
|
2
|
+
import type { nestedTree } from '../../types/misc';
|
|
3
|
+
export default class tagsModule extends ParserModule {
|
|
4
|
+
cmdName: string[];
|
|
5
|
+
requiredAttr: string[][];
|
|
6
|
+
doCheckRequiredAttr: boolean;
|
|
7
|
+
private recurModify;
|
|
8
|
+
evaluate(cmd: string, args: moduleInputObject, option: parseOptions, raw: string): nestedTree<DisplayComponent>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parser_1 = require("../../types/abstract/parser");
|
|
4
|
+
class tagsModule extends parser_1.ParserModule {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.cmdName = ["tags"];
|
|
8
|
+
this.requiredAttr = [["ID"]];
|
|
9
|
+
this.doCheckRequiredAttr = true;
|
|
10
|
+
}
|
|
11
|
+
recurModify(tree, sectionIDs) {
|
|
12
|
+
tree.forEach(i => {
|
|
13
|
+
if (i instanceof parser_1.DisplayComponent) {
|
|
14
|
+
i.addSectionID(sectionIDs);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.recurModify(i, sectionIDs);
|
|
18
|
+
}
|
|
19
|
+
;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
evaluate(cmd, args, option, raw) {
|
|
23
|
+
let IDs = args.getAttr("ID").split(" ");
|
|
24
|
+
let final = args.getChilren();
|
|
25
|
+
this.recurModify(final, IDs);
|
|
26
|
+
return final;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = tagsModule;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DisplayComponent, ParserModule, moduleInputObject, parseOptions } from '../../types/abstract/parser';
|
|
2
|
+
import type { nestedTree } from '../../types/misc';
|
|
3
|
+
export default class uadduminusModule extends ParserModule {
|
|
4
|
+
cmdName: string[];
|
|
5
|
+
requiredAttr: never[][];
|
|
6
|
+
doCheckRequiredAttr: boolean;
|
|
7
|
+
private recurModify;
|
|
8
|
+
evaluate(cmd: string, args: moduleInputObject, option: parseOptions, raw: string): nestedTree<DisplayComponent>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parser_1 = require("../../types/abstract/parser");
|
|
4
|
+
class uadduminusModule extends parser_1.ParserModule {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.cmdName = ['uadd', 'uminus'];
|
|
8
|
+
this.requiredAttr = [[], []];
|
|
9
|
+
this.doCheckRequiredAttr = false;
|
|
10
|
+
}
|
|
11
|
+
recurModify(tree, sectionID) {
|
|
12
|
+
tree.forEach(i => {
|
|
13
|
+
if (i instanceof parser_1.DisplayComponent) {
|
|
14
|
+
i.addSectionID(sectionID);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.recurModify(i, sectionID);
|
|
18
|
+
}
|
|
19
|
+
;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
evaluate(cmd, args, option, raw) {
|
|
23
|
+
let k = args.getChilren();
|
|
24
|
+
if (option.mode == parser_1.mode.debug)
|
|
25
|
+
return k;
|
|
26
|
+
//remove bracket by default
|
|
27
|
+
let upgradeFlag = option.cardData && option.cardData.variants.join(" ").toLowerCase().includes("upgrade");
|
|
28
|
+
if ((upgradeFlag && cmd == "uminus") || (!upgradeFlag && cmd == "uadd")) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
if (option.mode == parser_1.mode.info) {
|
|
32
|
+
k = [
|
|
33
|
+
[new parser_1.TextComponent("[", undefined, cmd, raw)],
|
|
34
|
+
k,
|
|
35
|
+
[new parser_1.TextComponent("]", undefined, cmd, raw)]
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
this.recurModify(k, cmd);
|
|
39
|
+
return k;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = uadduminusModule;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DisplayComponent, ParserModule, moduleInputObject, parseOptions } from '../../types/abstract/parser';
|
|
2
|
+
import type { nestedTree } from '../../types/misc';
|
|
3
|
+
export default class variantCheckModule extends ParserModule {
|
|
4
|
+
cmdName: string[];
|
|
5
|
+
requiredAttr: any[];
|
|
6
|
+
doCheckRequiredAttr: boolean;
|
|
7
|
+
isValidAttr(cmdIndex: number, attrName: string, attr: string): boolean;
|
|
8
|
+
private recurModify;
|
|
9
|
+
evaluate(cmd: string, args: moduleInputObject, option: parseOptions, raw: string): nestedTree<DisplayComponent>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const parser_1 = require("../../types/abstract/parser");
|
|
4
|
+
class variantCheckModule extends parser_1.ParserModule {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.cmdName = [
|
|
8
|
+
'variantInclude', 'variantExclude'
|
|
9
|
+
];
|
|
10
|
+
this.requiredAttr = new Array(2).fill(["variantID"]);
|
|
11
|
+
this.doCheckRequiredAttr = true;
|
|
12
|
+
}
|
|
13
|
+
isValidAttr(cmdIndex, attrName, attr) {
|
|
14
|
+
const k = attr.split(" ");
|
|
15
|
+
for (let i = 0; i < k.length; i++) {
|
|
16
|
+
if (!k[i].length)
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
recurModify(tree, sectionID) {
|
|
22
|
+
tree.forEach(i => {
|
|
23
|
+
if (i instanceof parser_1.DisplayComponent) {
|
|
24
|
+
i.addSectionID(sectionID);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.recurModify(i, sectionID);
|
|
28
|
+
}
|
|
29
|
+
;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
evaluate(cmd, args, option, raw) {
|
|
33
|
+
let k = args.getChilren();
|
|
34
|
+
if (option.mode == parser_1.mode.debug)
|
|
35
|
+
return k;
|
|
36
|
+
//remove bracket by default
|
|
37
|
+
const checkVariant = args.getAttr("expr").split(' ');
|
|
38
|
+
let correctVariantFlag = option.cardData && option.cardData.variants.some(i => checkVariant.includes(i));
|
|
39
|
+
if ((correctVariantFlag && cmd == "variantExclude") || (!correctVariantFlag && cmd == "variantInclude")) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
if (option.mode == parser_1.mode.info) {
|
|
43
|
+
k = [
|
|
44
|
+
[new parser_1.TextComponent("[", undefined, cmd, raw)],
|
|
45
|
+
k,
|
|
46
|
+
[new parser_1.TextComponent("]", undefined, cmd, raw)]
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
this.recurModify(k, cmd);
|
|
50
|
+
return k;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = variantCheckModule;
|