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.
- package/README.md +335 -180
- package/package.json +2 -7
- package/lib/_localizationFiles/English.d.ts +0 -2
- package/lib/_localizationFiles/English.js +0 -307
- package/lib/_mods/parserModules/addSymbol.d.ts +0 -7
- package/lib/_mods/parserModules/addSymbol.js +0 -18
- package/lib/_mods/parserModules/expression.d.ts +0 -7
- package/lib/_mods/parserModules/expression.js +0 -45
- package/lib/_mods/parserModules/expression_parser.d.ts +0 -143
- package/lib/_mods/parserModules/expression_parser.js +0 -728
- package/lib/_mods/parserModules/img.d.ts +0 -8
- package/lib/_mods/parserModules/img.js +0 -42
- package/lib/_mods/parserModules/qpOriginal.d.ts +0 -5
- package/lib/_mods/parserModules/qpOriginal.js +0 -27
- package/lib/_mods/parserModules/sectionID.d.ts +0 -13
- package/lib/_mods/parserModules/sectionID.js +0 -56
- package/lib/_mods/parserModules/tags.d.ts +0 -9
- package/lib/_mods/parserModules/tags.js +0 -29
- package/lib/_mods/parserModules/uaddminus.d.ts +0 -9
- package/lib/_mods/parserModules/uaddminus.js +0 -42
- package/lib/_mods/parserModules/variantCheck.d.ts +0 -10
- package/lib/_mods/parserModules/variantCheck.js +0 -53
- package/lib/_queenSystem/handler/actionGenrator.d.ts +0 -994
- package/lib/_queenSystem/handler/actionGenrator.js +0 -646
- package/lib/_queenSystem/handler/actionInputGenerator.d.ts +0 -95
- package/lib/_queenSystem/handler/actionInputGenerator.js +0 -373
- package/lib/_queenSystem/handler/actionInputRequesterGenerator.d.ts +0 -92
- package/lib/_queenSystem/handler/actionInputRequesterGenerator.js +0 -341
- package/lib/_queenSystem/handler/cardHandler.d.ts +0 -20
- package/lib/_queenSystem/handler/cardHandler.js +0 -61
- package/lib/_queenSystem/handler/effectGenerator.d.ts +0 -1
- package/lib/_queenSystem/handler/effectGenerator.js +0 -127
- package/lib/_queenSystem/handler/localizationHandler.d.ts +0 -28
- package/lib/_queenSystem/handler/localizationHandler.js +0 -166
- package/lib/_queenSystem/handler/modHandler.d.ts +0 -10
- package/lib/_queenSystem/handler/modHandler.js +0 -36
- package/lib/_queenSystem/handler/oldDataProcessor.d.ts +0 -9
- package/lib/_queenSystem/handler/oldDataProcessor.js +0 -129
- package/lib/_queenSystem/handler/registryHandler.d.ts +0 -36
- package/lib/_queenSystem/handler/registryHandler.js +0 -63
- package/lib/_queenSystem/handler/zoneHandler.d.ts +0 -102
- package/lib/_queenSystem/handler/zoneHandler.js +0 -606
- package/lib/_queenSystem/loader/loader_card.d.ts +0 -20
- package/lib/_queenSystem/loader/loader_card.js +0 -124
- package/lib/_queenSystem/loader/loader_effect.d.ts +0 -27
- package/lib/_queenSystem/loader/loader_effect.js +0 -163
- package/lib/_queenSystem/loader/loader_handler.d.ts +0 -11
- package/lib/_queenSystem/loader/loader_handler.js +0 -24
- package/lib/_queenSystem/loader/loader_localization.d.ts +0 -11
- package/lib/_queenSystem/loader/loader_localization.js +0 -73
- package/lib/_queenSystem/loader/loader_mod.d.ts +0 -10
- package/lib/_queenSystem/loader/loader_mod.js +0 -72
- package/lib/_queenSystem/loader/loader_subtype.d.ts +0 -9
- package/lib/_queenSystem/loader/loader_subtype.js +0 -39
- package/lib/_queenSystem/loader/loader_type.d.ts +0 -9
- package/lib/_queenSystem/loader/loader_type.js +0 -39
- package/lib/_queenSystem/loader/loader_zone.d.ts +0 -14
- package/lib/_queenSystem/loader/loader_zone.js +0 -35
- package/lib/_queenSystem/queenSystem.d.ts +0 -127
- package/lib/_queenSystem/queenSystem.js +0 -996
- package/lib/_queenSystem/renderer/rendererInterface.d.ts +0 -9
- package/lib/_queenSystem/renderer/rendererInterface.js +0 -2
- package/lib/data/actionRegistry.d.ts +0 -56
- package/lib/data/actionRegistry.js +0 -60
- package/lib/data/cardRegistry.d.ts +0 -1162
- package/lib/data/cardRegistry.js +0 -716
- package/lib/data/deckRegistry.d.ts +0 -19
- package/lib/data/deckRegistry.js +0 -41
- package/lib/data/effectRegistry.d.ts +0 -465
- package/lib/data/effectRegistry.js +0 -151
- package/lib/data/effectTypeRegistry.d.ts +0 -14
- package/lib/data/effectTypeRegistry.js +0 -14
- package/lib/data/operatorRegistry.d.ts +0 -92
- package/lib/data/operatorRegistry.js +0 -82
- package/lib/data/rarityRegistry.d.ts +0 -28
- package/lib/data/rarityRegistry.js +0 -63
- package/lib/data/registryRegistry.d.ts +0 -10
- package/lib/data/registryRegistry.js +0 -14
- package/lib/data/subtypeRegistry.d.ts +0 -15
- package/lib/data/subtypeRegistry.js +0 -15
- package/lib/data/systemRegistry.d.ts +0 -253
- package/lib/data/systemRegistry.js +0 -56
- package/lib/data/zoneRegistry.d.ts +0 -43
- package/lib/data/zoneRegistry.js +0 -157
- package/lib/effectTextParser/index.d.ts +0 -42
- package/lib/effectTextParser/index.js +0 -316
- package/lib/global/index.d.ts +0 -8
- package/lib/global/index.js +0 -12
- package/lib/index.d.ts +0 -6341
- package/lib/index.js +0 -212
- package/lib/specificEffects/e_cond.d.ts +0 -11
- package/lib/specificEffects/e_cond.js +0 -36
- package/lib/specificEffects/e_fruit.d.ts +0 -3
- package/lib/specificEffects/e_fruit.js +0 -187
- package/lib/specificEffects/e_generic.d.ts +0 -191
- package/lib/specificEffects/e_generic.js +0 -662
- package/lib/specificEffects/e_generic_cardTargetting.d.ts +0 -38
- package/lib/specificEffects/e_generic_cardTargetting.js +0 -82
- package/lib/specificEffects/e_generic_noneTargetting.d.ts +0 -10
- package/lib/specificEffects/e_generic_noneTargetting.js +0 -26
- package/lib/specificEffects/e_status.d.ts +0 -80
- package/lib/specificEffects/e_status.js +0 -151
- package/lib/specificEffects/e_test.d.ts +0 -3
- package/lib/specificEffects/e_test.js +0 -21
- package/lib/types/abstract/gameComponents/API.d.ts +0 -19
- package/lib/types/abstract/gameComponents/API.js +0 -2
- package/lib/types/abstract/gameComponents/card.d.ts +0 -108
- package/lib/types/abstract/gameComponents/card.js +0 -771
- package/lib/types/abstract/gameComponents/effect.d.ts +0 -82
- package/lib/types/abstract/gameComponents/effect.js +0 -331
- package/lib/types/abstract/gameComponents/effectSubtype.d.ts +0 -22
- package/lib/types/abstract/gameComponents/effectSubtype.js +0 -40
- package/lib/types/abstract/gameComponents/effectType.d.ts +0 -11
- package/lib/types/abstract/gameComponents/effectType.js +0 -8
- package/lib/types/abstract/gameComponents/settings.d.ts +0 -80
- package/lib/types/abstract/gameComponents/settings.js +0 -68
- package/lib/types/abstract/gameComponents/zone.d.ts +0 -113
- package/lib/types/abstract/gameComponents/zone.js +0 -614
- package/lib/types/abstract/gameComponents/zone_gridBased.d.ts +0 -18
- package/lib/types/abstract/gameComponents/zone_gridBased.js +0 -58
- package/lib/types/abstract/gameComponents/zone_stackBased.d.ts +0 -13
- package/lib/types/abstract/gameComponents/zone_stackBased.js +0 -55
- package/lib/types/abstract/generics/node.d.ts +0 -23
- package/lib/types/abstract/generics/node.js +0 -46
- package/lib/types/abstract/generics/position.d.ts +0 -23
- package/lib/types/abstract/generics/position.js +0 -91
- package/lib/types/abstract/generics/tree.d.ts +0 -25
- package/lib/types/abstract/generics/tree.js +0 -153
- package/lib/types/abstract/generics/universalResponse.d.ts +0 -4
- package/lib/types/abstract/generics/universalResponse.js +0 -2
- package/lib/types/abstract/generics/wraper.d.ts +0 -21
- package/lib/types/abstract/generics/wraper.js +0 -56
- package/lib/types/abstract/parser/component.d.ts +0 -88
- package/lib/types/abstract/parser/component.js +0 -132
- package/lib/types/abstract/parser/index.d.ts +0 -6
- package/lib/types/abstract/parser/index.js +0 -28
- package/lib/types/abstract/parser/modPack.d.ts +0 -21
- package/lib/types/abstract/parser/modPack.js +0 -48
- package/lib/types/abstract/parser/moduleInputObject.d.ts +0 -12
- package/lib/types/abstract/parser/moduleInputObject.js +0 -21
- package/lib/types/abstract/parser/options.d.ts +0 -31
- package/lib/types/abstract/parser/options.js +0 -45
- package/lib/types/abstract/serializedGameComponents/Gamestate.d.ts +0 -46
- package/lib/types/abstract/serializedGameComponents/Gamestate.js +0 -70
- package/lib/types/abstract/serializedGameComponents/Localized.d.ts +0 -69
- package/lib/types/abstract/serializedGameComponents/Localized.js +0 -84
- package/lib/types/defaultZones/ability.d.ts +0 -10
- package/lib/types/defaultZones/ability.js +0 -22
- package/lib/types/defaultZones/deck.d.ts +0 -25
- package/lib/types/defaultZones/deck.js +0 -90
- package/lib/types/defaultZones/drop.d.ts +0 -5
- package/lib/types/defaultZones/drop.js +0 -13
- package/lib/types/defaultZones/field.d.ts +0 -11
- package/lib/types/defaultZones/field.js +0 -35
- package/lib/types/defaultZones/grave.d.ts +0 -8
- package/lib/types/defaultZones/grave.js +0 -21
- package/lib/types/defaultZones/hand.d.ts +0 -5
- package/lib/types/defaultZones/hand.js +0 -14
- package/lib/types/defaultZones/storage.d.ts +0 -9
- package/lib/types/defaultZones/storage.js +0 -21
- package/lib/types/defaultZones/system.d.ts +0 -12
- package/lib/types/defaultZones/system.js +0 -35
- package/lib/types/defaultZones/void.d.ts +0 -4
- package/lib/types/defaultZones/void.js +0 -10
- package/lib/types/effects/effectSubtypes/subtype_chained.d.ts +0 -10
- package/lib/types/effects/effectSubtypes/subtype_chained.js +0 -17
- package/lib/types/effects/effectSubtypes/subtype_delayed.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_delayed.js +0 -16
- package/lib/types/effects/effectSubtypes/subtype_fieldLock.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_fieldLock.js +0 -21
- package/lib/types/effects/effectSubtypes/subtype_graveLock.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_graveLock.js +0 -21
- package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_hand_or_fieldLock.js +0 -21
- package/lib/types/effects/effectSubtypes/subtype_hardUnique.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_hardUnique.js +0 -15
- package/lib/types/effects/effectSubtypes/subtype_instant.d.ts +0 -8
- package/lib/types/effects/effectSubtypes/subtype_instant.js +0 -20
- package/lib/types/effects/effectSubtypes/subtype_once.d.ts +0 -12
- package/lib/types/effects/effectSubtypes/subtype_once.js +0 -27
- package/lib/types/effects/effectSubtypes/subtype_unique.d.ts +0 -9
- package/lib/types/effects/effectSubtypes/subtype_unique.js +0 -16
- package/lib/types/effects/effectTypes/initEffect.d.ts +0 -7
- package/lib/types/effects/effectTypes/initEffect.js +0 -23
- package/lib/types/effects/effectTypes/lockEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/lockEffect.js +0 -25
- package/lib/types/effects/effectTypes/manualEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/manualEffect.js +0 -18
- package/lib/types/effects/effectTypes/passiveEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/passiveEffect.js +0 -23
- package/lib/types/effects/effectTypes/triggerEffect.d.ts +0 -9
- package/lib/types/effects/effectTypes/triggerEffect.js +0 -28
- package/lib/types/errors/cannotLoad.d.ts +0 -5
- package/lib/types/errors/cannotLoad.js +0 -13
- package/lib/types/errors/cardNotExist.d.ts +0 -5
- package/lib/types/errors/cardNotExist.js +0 -13
- package/lib/types/errors/cardNotInApplicableZone.d.ts +0 -5
- package/lib/types/errors/cardNotInApplicableZone.js +0 -13
- package/lib/types/errors/effectCondNotMet.d.ts +0 -5
- package/lib/types/errors/effectCondNotMet.js +0 -13
- package/lib/types/errors/effectNotExist.d.ts +0 -5
- package/lib/types/errors/effectNotExist.js +0 -13
- package/lib/types/errors/error.d.ts +0 -17
- package/lib/types/errors/error.js +0 -42
- package/lib/types/errors/incorrectActionType.d.ts +0 -5
- package/lib/types/errors/incorrectActionType.js +0 -13
- package/lib/types/errors/index.d.ts +0 -16
- package/lib/types/errors/index.js +0 -36
- package/lib/types/errors/invalidOrderMap.d.ts +0 -6
- package/lib/types/errors/invalidOrderMap.js +0 -14
- package/lib/types/errors/invalidPosition.d.ts +0 -6
- package/lib/types/errors/invalidPosition.js +0 -13
- package/lib/types/errors/subTypeOverrideConflict.d.ts +0 -7
- package/lib/types/errors/subTypeOverrideConflict.js +0 -15
- package/lib/types/errors/unknownError.d.ts +0 -5
- package/lib/types/errors/unknownError.js +0 -13
- package/lib/types/errors/unregisteredAction.d.ts +0 -6
- package/lib/types/errors/unregisteredAction.js +0 -13
- package/lib/types/errors/wrongEffectIdx.d.ts +0 -5
- package/lib/types/errors/wrongEffectIdx.js +0 -14
- package/lib/types/errors/zoneAttrConflict.d.ts +0 -5
- package/lib/types/errors/zoneAttrConflict.js +0 -15
- package/lib/types/errors/zoneFull.d.ts +0 -5
- package/lib/types/errors/zoneFull.js +0 -13
- package/lib/types/errors/zoneNotExist.d.ts +0 -5
- package/lib/types/errors/zoneNotExist.js +0 -13
- package/lib/types/misc.d.ts +0 -97
- package/lib/types/misc.js +0 -8
- package/lib/types/mods/effectTextParserModule.d.ts +0 -16
- package/lib/types/mods/effectTextParserModule.js +0 -81
- package/lib/types/mods/gameModule.d.ts +0 -5
- package/lib/types/mods/gameModule.js +0 -8
- package/lib/utils/index.d.ts +0 -78
- package/lib/utils/index.js +0 -562
|
@@ -1,124 +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 card_1 = __importDefault(require("../../types/abstract/gameComponents/card"));
|
|
7
|
-
const effect_1 = __importDefault(require("../../types/abstract/gameComponents/effect"));
|
|
8
|
-
//Cards have 2 parts
|
|
9
|
-
//Data and Code
|
|
10
|
-
//As denoted b4 in the README file, there are 3 approaches
|
|
11
|
-
// naive -> load everything into mem
|
|
12
|
-
// dynamic -> async load both class and data if needed
|
|
13
|
-
// fixxed size cache -> use some kind of eviction sheme, similar to paging
|
|
14
|
-
class cardLoader {
|
|
15
|
-
constructor(effectHandler) {
|
|
16
|
-
this.dataCache = new Map();
|
|
17
|
-
this.customClassCache = new Map();
|
|
18
|
-
this.countCache = new Map();
|
|
19
|
-
this.effectHandler = effectHandler;
|
|
20
|
-
}
|
|
21
|
-
get classkeys() {
|
|
22
|
-
return Array.from(this.customClassCache.keys());
|
|
23
|
-
}
|
|
24
|
-
get datakeys() {
|
|
25
|
-
return Array.from(this.dataCache.keys());
|
|
26
|
-
}
|
|
27
|
-
load(key, data, c) {
|
|
28
|
-
this.dataCache.set(key, data);
|
|
29
|
-
if (c) {
|
|
30
|
-
if (typeof c === "function")
|
|
31
|
-
this.customClassCache.set(key, c);
|
|
32
|
-
else {
|
|
33
|
-
for (const key in Object.keys(c)) {
|
|
34
|
-
this.customClassCache.set(key, c[key]);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
getCard(cid, s, variantid, dataOnly = false) {
|
|
40
|
-
let data = this.dataCache.get(cid);
|
|
41
|
-
if (!data)
|
|
42
|
-
return undefined;
|
|
43
|
-
let cclass = this.customClassCache.get(cid);
|
|
44
|
-
if (!cclass)
|
|
45
|
-
cclass = card_1.default;
|
|
46
|
-
let c = this.countCache.get(cid);
|
|
47
|
-
c = (c) ? (c + 1) % s.max_id_count : 0;
|
|
48
|
-
if (!dataOnly)
|
|
49
|
-
this.countCache.set(cid, c);
|
|
50
|
-
let runID = variantid ? Utils.dataIDToUniqueID(cid, c, s, ...variantid) : Utils.dataIDToUniqueID(cid, c, s);
|
|
51
|
-
if (!data.variantData) {
|
|
52
|
-
console.log("invalid data somehow", JSON.stringify(data));
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
|
-
let baseData = data.variantData.base;
|
|
56
|
-
let d = Object.assign({ id: runID, dataID: cid, variants: variantid !== null && variantid !== void 0 ? variantid : ["base"] }, baseData);
|
|
57
|
-
if (variantid) {
|
|
58
|
-
variantid.forEach(i => {
|
|
59
|
-
Utils.patchCardData(d, data.variantData[i]);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
let effArr = [];
|
|
63
|
-
let effDataArr = [];
|
|
64
|
-
Object.keys(d.effects).forEach(i => {
|
|
65
|
-
var _a, _b;
|
|
66
|
-
const eObj = d.effects[i];
|
|
67
|
-
function Load(t, eObj) {
|
|
68
|
-
// console.log("Trying to load eff: ", JSON.stringify(eObj))
|
|
69
|
-
let e = t.effectHandler.getEffect(i, s, eObj, dataOnly);
|
|
70
|
-
if (!e)
|
|
71
|
-
return console.log(`Effect id not found: ${i}\n`);
|
|
72
|
-
if (e instanceof effect_1.default)
|
|
73
|
-
effArr.push(e);
|
|
74
|
-
else
|
|
75
|
-
effDataArr.push(e);
|
|
76
|
-
}
|
|
77
|
-
if (eObj && typeof eObj.__loadOptions === "object") {
|
|
78
|
-
if (eObj.__loadOptions.___internalMultipleLoadCount || eObj.__loadOptions.__additionalPatches) {
|
|
79
|
-
let t1 = (_a = eObj.__loadOptions.___internalMultipleLoadCount) !== null && _a !== void 0 ? _a : 0;
|
|
80
|
-
let t2 = ((_b = eObj.__loadOptions.__additionalPatches) !== null && _b !== void 0 ? _b : []).length;
|
|
81
|
-
let t = Math.max(t1, t2);
|
|
82
|
-
if (!Number.isFinite(t))
|
|
83
|
-
console.log("Trying to load an infinite ammounnt of effects: ", cid, eObj);
|
|
84
|
-
else if (t > 0) {
|
|
85
|
-
for (let z = 0; z < t; z++) {
|
|
86
|
-
Load(this, eObj.__loadOptions.__additionalPatches ? eObj.__loadOptions.__additionalPatches[z] : eObj);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
Load(this, eObj);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
if (effArr.length != Object.keys(d.effects).length && !s.ignore_undefined_effect) {
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
// console.log(`
|
|
99
|
-
// debug log: loading card ${cid}, loaded ${effArr.length} effects\n`)
|
|
100
|
-
if (dataOnly) {
|
|
101
|
-
const res = d;
|
|
102
|
-
res.effects = effDataArr;
|
|
103
|
-
return res;
|
|
104
|
-
}
|
|
105
|
-
return new cclass(s, d, effArr);
|
|
106
|
-
}
|
|
107
|
-
getDirect(cid, s, ...eff) {
|
|
108
|
-
//default partiton scheme: all eff into one partiton
|
|
109
|
-
let data = this.dataCache.get("c_test");
|
|
110
|
-
if (!data)
|
|
111
|
-
return undefined;
|
|
112
|
-
let c = this.countCache.get(cid);
|
|
113
|
-
c = (c) ? (c + 1) % s.max_id_count : 0;
|
|
114
|
-
this.countCache.set(cid, c);
|
|
115
|
-
let runID = Utils.dataIDToUniqueID(cid, c, s);
|
|
116
|
-
let baseData = data.variantData.base;
|
|
117
|
-
let d = Object.assign({ id: runID, dataID: cid, variants: ["base"] }, baseData);
|
|
118
|
-
d.effects = Object.fromEntries(eff.map(e => [e.dataID, e.originalData]));
|
|
119
|
-
d.partition[0].mapping = Utils.range(eff.length);
|
|
120
|
-
d.partition[0].displayID = cid;
|
|
121
|
-
return new card_1.default(s, d, eff);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.default = cardLoader;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Effect from "../../types/abstract/gameComponents/effect";
|
|
2
|
-
import type { effectData } from "../../data/cardRegistry";
|
|
3
|
-
import type { Setting } from "../../types/abstract/gameComponents/settings";
|
|
4
|
-
import type subtypeLoader from "./loader_subtype";
|
|
5
|
-
import type typeLoader from "./loader_type";
|
|
6
|
-
import type effectDataRegistry from "../../data/effectRegistry";
|
|
7
|
-
export default class effectLoader {
|
|
8
|
-
private dataCache;
|
|
9
|
-
private classCache;
|
|
10
|
-
private countCache;
|
|
11
|
-
private subtypeLoader;
|
|
12
|
-
private typeLoader;
|
|
13
|
-
constructor(dataRegistry: Record<string, effectData> | typeof effectDataRegistry, subtypeLoader: subtypeLoader, typeLoader: typeLoader);
|
|
14
|
-
get classkeys(): string[];
|
|
15
|
-
get datakeys(): string[];
|
|
16
|
-
private loadSingle;
|
|
17
|
-
load(s: Setting): Promise<void>;
|
|
18
|
-
add(key: string, data: effectData): void;
|
|
19
|
-
add(key: string, constructor: typeof Effect): void;
|
|
20
|
-
private validator;
|
|
21
|
-
getEffect(eid: keyof typeof effectDataRegistry, s: Setting, edata?: Partial<effectData>): Effect;
|
|
22
|
-
getEffect(eid: string, s: Setting, edata?: Partial<effectData>): Effect | undefined;
|
|
23
|
-
getEffect(eid: keyof typeof effectDataRegistry, s: Setting, edata: Partial<effectData>, dataOnly: true): effectData;
|
|
24
|
-
getEffect(eid: string, s: Setting, edata: Partial<effectData>, dataOnly: true): effectData | undefined;
|
|
25
|
-
getEffect(eid: string, s: Setting, edata?: Partial<effectData>, dataOnly?: boolean): effectData | Effect | undefined;
|
|
26
|
-
getDirect(eid: string, s: Setting, eclass: typeof Effect | Function, data: effectData): Effect<import("../../data/systemRegistry").inputData_standard[]> | undefined;
|
|
27
|
-
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
const effect_1 = __importDefault(require("../../types/abstract/gameComponents/effect"));
|
|
49
|
-
//Cards have 2 parts
|
|
50
|
-
//Data and Code
|
|
51
|
-
//As denoted b4 in the README file, there are 3 approaches
|
|
52
|
-
// naive -> load everything into mem
|
|
53
|
-
// dynamic -> async load both class and data if needed
|
|
54
|
-
// fixxed size cache -> use some kind of eviction scheme, similar to paging
|
|
55
|
-
class effectLoader {
|
|
56
|
-
constructor(dataRegistry, subtypeLoader, typeLoader) {
|
|
57
|
-
this.classCache = new Map();
|
|
58
|
-
this.countCache = new Map();
|
|
59
|
-
this.dataCache = new Map(Object.entries(dataRegistry));
|
|
60
|
-
this.subtypeLoader = subtypeLoader;
|
|
61
|
-
this.typeLoader = typeLoader;
|
|
62
|
-
}
|
|
63
|
-
get classkeys() {
|
|
64
|
-
return Array.from(this.classCache.keys());
|
|
65
|
-
}
|
|
66
|
-
get datakeys() {
|
|
67
|
-
return Array.from(this.dataCache.keys());
|
|
68
|
-
}
|
|
69
|
-
loadSingle(path, eid, s) {
|
|
70
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
const obj = (yield Promise.resolve(`${path + eid}`).then(s => __importStar(require(s)))).default;
|
|
72
|
-
if (typeof obj === "function") {
|
|
73
|
-
this.classCache.set(eid, obj);
|
|
74
|
-
}
|
|
75
|
-
else if (typeof obj === "object") {
|
|
76
|
-
Object.keys(obj).forEach(k => {
|
|
77
|
-
if (typeof obj[k] === "function") {
|
|
78
|
-
this.classCache.set(k, obj[k]);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
load(s) {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
let path = s.effectFolder;
|
|
87
|
-
if (!path.endsWith("/"))
|
|
88
|
-
path += "/";
|
|
89
|
-
let arr = [];
|
|
90
|
-
s.effectFiles.forEach(eid => {
|
|
91
|
-
arr.push(this.loadSingle(path, eid, s));
|
|
92
|
-
});
|
|
93
|
-
yield Promise.all(arr);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
;
|
|
97
|
-
add(key, param) {
|
|
98
|
-
if (typeof param == "function") {
|
|
99
|
-
this.classCache.set(key, param);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
this.dataCache.set(key, param);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
//most hacky fix ever
|
|
106
|
-
//ahhhh
|
|
107
|
-
//TODO : find a better solution
|
|
108
|
-
validator(x) {
|
|
109
|
-
try {
|
|
110
|
-
x();
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
try {
|
|
115
|
-
return e.message.includes("cannot be invoked without 'new'");
|
|
116
|
-
}
|
|
117
|
-
catch (e) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
getEffect(eid, s, edata, dataOnly = false) {
|
|
123
|
-
let data = this.dataCache.get(eid);
|
|
124
|
-
if (!data)
|
|
125
|
-
return undefined;
|
|
126
|
-
if (edata)
|
|
127
|
-
Utils.patchGeneric(data, edata);
|
|
128
|
-
if (dataOnly)
|
|
129
|
-
return data;
|
|
130
|
-
let eclass = this.classCache.get(eid);
|
|
131
|
-
if (!eclass) {
|
|
132
|
-
console.log("No class Data for key ", eid);
|
|
133
|
-
return undefined;
|
|
134
|
-
}
|
|
135
|
-
return this.getDirect(eid, s, eclass, data);
|
|
136
|
-
}
|
|
137
|
-
getDirect(eid, s, eclass, data) {
|
|
138
|
-
let c = this.countCache.get(eid);
|
|
139
|
-
c = (c) ? (c + 1) % s.max_id_count : 0;
|
|
140
|
-
this.countCache.set(eid, c);
|
|
141
|
-
//load type
|
|
142
|
-
let type = this.typeLoader.getType(data.typeID, s, eid);
|
|
143
|
-
if (!type)
|
|
144
|
-
return undefined;
|
|
145
|
-
let runID = Utils.dataIDToUniqueID(eid, c, s, ...data.subTypeIDs);
|
|
146
|
-
//load subtypes
|
|
147
|
-
let k = [];
|
|
148
|
-
data.subTypeIDs.forEach(i => {
|
|
149
|
-
let st = this.subtypeLoader.getSubtype(i, s, eid);
|
|
150
|
-
if (st)
|
|
151
|
-
k.push(st);
|
|
152
|
-
});
|
|
153
|
-
if (k.length != data.subTypeIDs.length && !s.ignore_undefined_subtype) {
|
|
154
|
-
return undefined;
|
|
155
|
-
}
|
|
156
|
-
if (this.validator(eclass)) {
|
|
157
|
-
const res = new eclass(runID, eid, type, k, data);
|
|
158
|
-
return (res instanceof effect_1.default) ? res : undefined;
|
|
159
|
-
}
|
|
160
|
-
return undefined;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
exports.default = effectLoader;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Action } from "../handler/actionGenrator";
|
|
2
|
-
import type queenSystem from "../queenSystem";
|
|
3
|
-
type handlerFunc = ((a: Action, system: queenSystem) => undefined | Action[]);
|
|
4
|
-
export default class customHandlerLoader {
|
|
5
|
-
private funcCache;
|
|
6
|
-
___ObtainFunc(actionTypeID: number): handlerFunc | undefined;
|
|
7
|
-
delete(actionTypeID: number): void;
|
|
8
|
-
load(actionTypeID: number, handlerFunc: handlerFunc): void;
|
|
9
|
-
handle(actionTypeID: number, a: Action, s: queenSystem): import("../handler/actionGenrator").Action_class<import("../../data/systemRegistry").identificationInfo[], any, any>[] | undefined;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class customHandlerLoader {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.funcCache = new Map();
|
|
6
|
-
}
|
|
7
|
-
___ObtainFunc(actionTypeID) {
|
|
8
|
-
return this.funcCache.get(actionTypeID);
|
|
9
|
-
}
|
|
10
|
-
delete(actionTypeID) {
|
|
11
|
-
this.funcCache.delete(actionTypeID);
|
|
12
|
-
}
|
|
13
|
-
load(actionTypeID, handlerFunc) {
|
|
14
|
-
this.funcCache.set(actionTypeID, handlerFunc);
|
|
15
|
-
}
|
|
16
|
-
handle(actionTypeID, a, s) {
|
|
17
|
-
let func = this.funcCache.get(actionTypeID);
|
|
18
|
-
if (!func)
|
|
19
|
-
return;
|
|
20
|
-
else
|
|
21
|
-
return func(a, s);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.default = customHandlerLoader;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { supporttedLanguages, type Setting } from "../../types/abstract/gameComponents/settings";
|
|
2
|
-
export default class localizationLoader {
|
|
3
|
-
private setting;
|
|
4
|
-
private localizationMap;
|
|
5
|
-
constructor(s: Setting);
|
|
6
|
-
load(): Promise<void>;
|
|
7
|
-
add(lang: string, key: string, val: string): void;
|
|
8
|
-
get currentLanguageID(): supporttedLanguages;
|
|
9
|
-
get currentLanguageStr(): string;
|
|
10
|
-
getSymbolMap(lang?: string): Record<string, string> | undefined;
|
|
11
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
const settings_1 = require("../../types/abstract/gameComponents/settings");
|
|
46
|
-
class localizationLoader {
|
|
47
|
-
constructor(s) {
|
|
48
|
-
this.localizationMap = new Map();
|
|
49
|
-
this.setting = s;
|
|
50
|
-
}
|
|
51
|
-
load() {
|
|
52
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
let p = this.setting.localizationFolder;
|
|
54
|
-
if (!p.endsWith("/"))
|
|
55
|
-
p += "/";
|
|
56
|
-
let map = (yield Promise.resolve(`${p + this.currentLanguageStr}`).then(s => __importStar(require(s)))).default;
|
|
57
|
-
this.localizationMap.set(this.currentLanguageStr, map);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
add(lang, key, val) {
|
|
61
|
-
if (!this.localizationMap.has(lang))
|
|
62
|
-
return;
|
|
63
|
-
this.localizationMap.get(lang)[key] = val;
|
|
64
|
-
}
|
|
65
|
-
get currentLanguageID() { return this.setting.languageID; }
|
|
66
|
-
get currentLanguageStr() { var _a; return (_a = settings_1.supporttedLanguages[this.currentLanguageID]) !== null && _a !== void 0 ? _a : "English"; }
|
|
67
|
-
getSymbolMap(lang = this.currentLanguageStr) {
|
|
68
|
-
if (!this.localizationMap.has(lang))
|
|
69
|
-
return;
|
|
70
|
-
return this.localizationMap.get(lang);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exports.default = localizationLoader;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Setting } from "../../types/abstract/gameComponents/settings";
|
|
2
|
-
export default class modLoader<T> {
|
|
3
|
-
private objectCache;
|
|
4
|
-
private setting;
|
|
5
|
-
constructor(s: Setting);
|
|
6
|
-
private loadSingle;
|
|
7
|
-
load(): Promise<void>;
|
|
8
|
-
getMod(name: string): T | undefined;
|
|
9
|
-
getAll(): T[];
|
|
10
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
//mods have empty constructor
|
|
46
|
-
class modLoader {
|
|
47
|
-
constructor(s) {
|
|
48
|
-
this.objectCache = new Map();
|
|
49
|
-
this.setting = s;
|
|
50
|
-
}
|
|
51
|
-
loadSingle(path, name) {
|
|
52
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
this.objectCache.set(name, (yield Promise.resolve(`${path + name}`).then(s => __importStar(require(s)))).default());
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
load() {
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
let s = this.setting.modFolder_game;
|
|
59
|
-
if (!s.endsWith("/"))
|
|
60
|
-
s += "/";
|
|
61
|
-
let promiseArr = this.setting.mods.map(i => this.loadSingle(s, i));
|
|
62
|
-
yield Promise.all(promiseArr);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
getMod(name) {
|
|
66
|
-
return this.objectCache.get(name);
|
|
67
|
-
}
|
|
68
|
-
getAll() {
|
|
69
|
-
return Array.from(this.objectCache.values());
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.default = modLoader;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type EffectSubtype from "../../types/abstract/gameComponents/effectSubtype";
|
|
2
|
-
import type { Setting } from "../../types/abstract/gameComponents/settings";
|
|
3
|
-
export default class subtypeLoader {
|
|
4
|
-
private classCache;
|
|
5
|
-
private instanceCache;
|
|
6
|
-
load(key: string, c: typeof EffectSubtype): void;
|
|
7
|
-
private getSubtype_manual;
|
|
8
|
-
getSubtype(stid: string, s: Setting, eid?: string): EffectSubtype | undefined;
|
|
9
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class subtypeLoader {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.classCache = new Map();
|
|
6
|
-
// private countCache : Map<string, number> = new Map()
|
|
7
|
-
this.instanceCache = new Map();
|
|
8
|
-
}
|
|
9
|
-
load(key, c) {
|
|
10
|
-
this.classCache.set(key, c);
|
|
11
|
-
}
|
|
12
|
-
;
|
|
13
|
-
getSubtype_manual(stid, s, eid) {
|
|
14
|
-
let stclass = this.classCache.get(stid);
|
|
15
|
-
if (!stclass)
|
|
16
|
-
return undefined;
|
|
17
|
-
// let c = this.countCache.get(stid);
|
|
18
|
-
// c = (c) ? (c + 1) % s.max_id_count : 0;
|
|
19
|
-
// this.countCache.set(stid, c);
|
|
20
|
-
// let runID = eid ? utils.dataIDToUniqueID(stid, c, s, eid) : utils.dataIDToUniqueID(stid, c, s)
|
|
21
|
-
return new stclass(stid);
|
|
22
|
-
}
|
|
23
|
-
getSubtype(stid, s, eid) {
|
|
24
|
-
if (s.singleton_effect_subtype) {
|
|
25
|
-
if (this.instanceCache.has(stid))
|
|
26
|
-
return this.instanceCache.get(stid);
|
|
27
|
-
let res = this.getSubtype_manual(stid, s, eid);
|
|
28
|
-
if (!res)
|
|
29
|
-
return res;
|
|
30
|
-
this.instanceCache.set(stid, res);
|
|
31
|
-
return res;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this.instanceCache.clear();
|
|
35
|
-
return this.getSubtype_manual(stid, s, eid);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.default = subtypeLoader;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type EffectType from "../../types/abstract/gameComponents/effectType";
|
|
2
|
-
import type { Setting } from "../../types/abstract/gameComponents/settings";
|
|
3
|
-
export default class typeLoader {
|
|
4
|
-
private classCache;
|
|
5
|
-
private instanceCache;
|
|
6
|
-
load(key: string, c: typeof EffectType): void;
|
|
7
|
-
private getType_manual;
|
|
8
|
-
getType(tid: string, s: Setting, eid?: string): EffectType | undefined;
|
|
9
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class typeLoader {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.classCache = new Map();
|
|
6
|
-
// private countCache : Map<string, number> = new Map()
|
|
7
|
-
this.instanceCache = new Map();
|
|
8
|
-
}
|
|
9
|
-
load(key, c) {
|
|
10
|
-
this.classCache.set(key, c);
|
|
11
|
-
}
|
|
12
|
-
;
|
|
13
|
-
getType_manual(tid, s, eid) {
|
|
14
|
-
let stclass = this.classCache.get(tid);
|
|
15
|
-
if (!stclass)
|
|
16
|
-
return undefined;
|
|
17
|
-
// let c = this.countCache.get(stid);
|
|
18
|
-
// c = (c) ? (c + 1) % s.max_id_count : 0;
|
|
19
|
-
// this.countCache.set(stid, c);
|
|
20
|
-
// let runID = eid ? utils.dataIDToUniqueID(stid, c, s, eid) : utils.dataIDToUniqueID(stid, c, s)
|
|
21
|
-
return new stclass(tid);
|
|
22
|
-
}
|
|
23
|
-
getType(tid, s, eid) {
|
|
24
|
-
if (s.singleton_effect_type) {
|
|
25
|
-
if (this.instanceCache.has(tid))
|
|
26
|
-
return this.instanceCache.get(tid);
|
|
27
|
-
let res = this.getType_manual(tid, s, eid);
|
|
28
|
-
if (!res)
|
|
29
|
-
return res;
|
|
30
|
-
this.instanceCache.set(tid, res);
|
|
31
|
-
return res;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this.instanceCache.clear();
|
|
35
|
-
return this.getType_manual(tid, s, eid);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.default = typeLoader;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type Zone from "../../types/abstract/gameComponents/zone";
|
|
2
|
-
import type { Setting } from "../../types/abstract/gameComponents/settings";
|
|
3
|
-
import type { zoneData } from "../../data/zoneRegistry";
|
|
4
|
-
import type { Zone_T } from "../../types/abstract/gameComponents/zone";
|
|
5
|
-
type ZoneContructor = new (...p: ConstructorParameters<typeof Zone>) => Zone_T;
|
|
6
|
-
export default class zoneLoader {
|
|
7
|
-
private classCache;
|
|
8
|
-
private dataCache;
|
|
9
|
-
private counter;
|
|
10
|
-
load(key: string, data?: zoneData, c?: ZoneContructor): void;
|
|
11
|
-
getData(key: string): zoneData | undefined;
|
|
12
|
-
getZone(zclassID: string, s: Setting, ptype?: number, pid?: number, zDataID?: string): Zone<undefined, undefined, undefined, undefined> | undefined;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class zoneLoader {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.classCache = new Map();
|
|
6
|
-
this.dataCache = new Map();
|
|
7
|
-
this.counter = 0;
|
|
8
|
-
}
|
|
9
|
-
//private instanceCache : Map<string, Zone> = new Map()
|
|
10
|
-
load(key, data, c) {
|
|
11
|
-
if (data)
|
|
12
|
-
this.dataCache.set(key, data);
|
|
13
|
-
if (c)
|
|
14
|
-
this.classCache.set(key, c);
|
|
15
|
-
}
|
|
16
|
-
;
|
|
17
|
-
getData(key) {
|
|
18
|
-
return this.dataCache.get(key);
|
|
19
|
-
}
|
|
20
|
-
getZone(zclassID, s, ptype = -1, pid = -1, zDataID) {
|
|
21
|
-
zDataID = zDataID !== null && zDataID !== void 0 ? zDataID : zclassID;
|
|
22
|
-
//setting unused for now, passed in as standard
|
|
23
|
-
let zclass = this.classCache.get(zclassID);
|
|
24
|
-
if (!zclass)
|
|
25
|
-
return undefined;
|
|
26
|
-
let data = this.dataCache.get(zDataID);
|
|
27
|
-
if (!data)
|
|
28
|
-
return undefined;
|
|
29
|
-
// commented out, may need later
|
|
30
|
-
let runID = Utils.dataIDToUniqueID(zclassID, this.counter, s, zDataID, ptype.toString(), pid.toString());
|
|
31
|
-
this.counter++;
|
|
32
|
-
return new zclass(-1, runID, zDataID, zclassID, ptype, pid, data);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.default = zoneLoader;
|