@adeficior/data-modifier 1.0.0-rc.12 → 1.0.0-rc.14
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/dist/common/id.d.ts +1 -0
- package/dist/common/id.js +4 -0
- package/dist/common/id.js.map +1 -1
- package/dist/common/ingredient/filter.d.ts +6 -0
- package/dist/common/ingredient/filter.js +97 -0
- package/dist/common/ingredient/filter.js.map +1 -0
- package/dist/common/ingredient/index.d.ts +74 -0
- package/dist/common/ingredient/index.js +112 -0
- package/dist/common/ingredient/index.js.map +1 -0
- package/dist/common/ingredient/input.d.ts +3 -0
- package/dist/common/ingredient/input.js +1 -0
- package/dist/common/ingredient/input.js.map +1 -0
- package/dist/common/ingredient/serializer.d.ts +17 -0
- package/dist/common/ingredient/serializer.js +112 -0
- package/dist/common/ingredient/serializer.js.map +1 -0
- package/dist/common/predicates.d.ts +2 -1
- package/dist/common/predicates.js.map +1 -1
- package/dist/common/result/filter.d.ts +6 -0
- package/dist/common/result/filter.js +68 -0
- package/dist/common/result/filter.js.map +1 -0
- package/dist/common/result/index.d.ts +41 -0
- package/dist/common/result/index.js +59 -0
- package/dist/common/result/index.js.map +1 -0
- package/dist/common/result/input.d.ts +3 -0
- package/dist/common/result/input.js +1 -0
- package/dist/common/result/input.js.map +1 -0
- package/dist/common/result/serializer.d.ts +15 -0
- package/dist/common/result/serializer.js +81 -0
- package/dist/common/result/serializer.js.map +1 -0
- package/dist/common/serializable.d.ts +6 -0
- package/dist/common/serializable.js +1 -0
- package/dist/common/serializable.js.map +1 -0
- package/dist/common/units.d.ts +1 -0
- package/dist/common/units.js +2 -0
- package/dist/common/units.js.map +1 -0
- package/dist/emit/blacklist.d.ts +4 -6
- package/dist/emit/blacklist.js +19 -21
- package/dist/emit/blacklist.js.map +1 -1
- package/dist/emit/data/loot.d.ts +6 -8
- package/dist/emit/data/loot.js +11 -13
- package/dist/emit/data/loot.js.map +1 -1
- package/dist/emit/data/recipe.d.ts +20 -18
- package/dist/emit/data/recipe.js +40 -29
- package/dist/emit/data/recipe.js.map +1 -1
- package/dist/emit/data/tags.d.ts +1 -1
- package/dist/emit/data/tags.js.map +1 -1
- package/dist/emit/polytoneTabs.d.ts +1 -1
- package/dist/emit/polytoneTabs.js +1 -2
- package/dist/emit/polytoneTabs.js.map +1 -1
- package/dist/emit/rule/lootTable.d.ts +2 -1
- package/dist/emit/rule/lootTable.js +4 -2
- package/dist/emit/rule/lootTable.js.map +1 -1
- package/dist/emit/rule/recipe.d.ts +7 -5
- package/dist/emit/rule/recipe.js.map +1 -1
- package/dist/emit/ruled.d.ts +2 -1
- package/dist/emit/ruled.js +5 -2
- package/dist/emit/ruled.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/loader/context.d.ts +12 -0
- package/dist/loader/context.js +1 -0
- package/dist/loader/context.js.map +1 -0
- package/dist/loader/pack.d.ts +13 -7
- package/dist/loader/pack.js +43 -25
- package/dist/loader/pack.js.map +1 -1
- package/dist/loader/recipe.d.ts +9 -5
- package/dist/loader/recipe.js +39 -48
- package/dist/loader/recipe.js.map +1 -1
- package/dist/loader/registry/dump.d.ts +0 -2
- package/dist/loader/registry/dump.js +0 -11
- package/dist/loader/registry/dump.js.map +1 -1
- package/dist/loader/registry/index.d.ts +0 -2
- package/dist/loader/registry/wrapped.d.ts +13 -0
- package/dist/loader/registry/wrapped.js +26 -0
- package/dist/loader/registry/wrapped.js.map +1 -0
- package/dist/loader/tags.d.ts +1 -1
- package/dist/loader/tags.js.map +1 -1
- package/dist/parser/adAstra.d.ts +5 -11
- package/dist/parser/adAstra.js +5 -5
- package/dist/parser/adAstra.js.map +1 -1
- package/dist/parser/botania.d.ts +10 -20
- package/dist/parser/botania.js +10 -10
- package/dist/parser/botania.js.map +1 -1
- package/dist/parser/create.d.ts +2 -4
- package/dist/parser/create.js +2 -2
- package/dist/parser/create.js.map +1 -1
- package/dist/parser/index.d.ts +7 -13
- package/dist/parser/index.js +7 -7
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/lootTable.d.ts +7 -6
- package/dist/parser/lootTable.js +25 -23
- package/dist/parser/lootTable.js.map +1 -1
- package/dist/parser/recipe/adAstra/conversion.d.ts +15 -14
- package/dist/parser/recipe/adAstra/conversion.js +27 -20
- package/dist/parser/recipe/adAstra/conversion.js.map +1 -1
- package/dist/parser/recipe/adAstra/hammering.d.ts +3 -17
- package/dist/parser/recipe/adAstra/hammering.js +2 -25
- package/dist/parser/recipe/adAstra/hammering.js.map +1 -1
- package/dist/parser/recipe/adAstra/inputOutput.d.ts +16 -19
- package/dist/parser/recipe/adAstra/inputOutput.js +37 -29
- package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -1
- package/dist/parser/recipe/adAstra/nasaWorkbench.d.ts +3 -19
- package/dist/parser/recipe/adAstra/nasaWorkbench.js +2 -28
- package/dist/parser/recipe/adAstra/nasaWorkbench.js.map +1 -1
- package/dist/parser/recipe/adAstra/spaceStation.d.ts +15 -14
- package/dist/parser/recipe/adAstra/spaceStation.js +33 -14
- package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -1
- package/dist/parser/recipe/botania/apothecary.d.ts +17 -14
- package/dist/parser/recipe/botania/apothecary.js +26 -17
- package/dist/parser/recipe/botania/apothecary.js.map +1 -1
- package/dist/parser/recipe/botania/blocks.d.ts +21 -0
- package/dist/parser/recipe/botania/blocks.js +77 -0
- package/dist/parser/recipe/botania/blocks.js.map +1 -0
- package/dist/parser/recipe/botania/brew.d.ts +13 -12
- package/dist/parser/recipe/botania/brew.js +16 -11
- package/dist/parser/recipe/botania/brew.js.map +1 -1
- package/dist/parser/recipe/botania/elvenTrade.d.ts +8 -13
- package/dist/parser/recipe/botania/elvenTrade.js +11 -22
- package/dist/parser/recipe/botania/elvenTrade.js.map +1 -1
- package/dist/parser/recipe/botania/gogWrapper.d.ts +12 -12
- package/dist/parser/recipe/botania/gogWrapper.js +14 -15
- package/dist/parser/recipe/botania/gogWrapper.js.map +1 -1
- package/dist/parser/recipe/botania/manaInfusion.d.ts +18 -15
- package/dist/parser/recipe/botania/manaInfusion.js +29 -21
- package/dist/parser/recipe/botania/manaInfusion.js.map +1 -1
- package/dist/parser/recipe/botania/nbtWrapper.d.ts +12 -12
- package/dist/parser/recipe/botania/nbtWrapper.js +12 -13
- package/dist/parser/recipe/botania/nbtWrapper.js.map +1 -1
- package/dist/parser/recipe/botania/orechid.d.ts +3 -30
- package/dist/parser/recipe/botania/orechid.js +2 -72
- package/dist/parser/recipe/botania/orechid.js.map +1 -1
- package/dist/parser/recipe/botania/pureDaisy.d.ts +3 -18
- package/dist/parser/recipe/botania/pureDaisy.js +2 -28
- package/dist/parser/recipe/botania/pureDaisy.js.map +1 -1
- package/dist/parser/recipe/botania/runicAltar.d.ts +8 -13
- package/dist/parser/recipe/botania/runicAltar.js +11 -22
- package/dist/parser/recipe/botania/runicAltar.js.map +1 -1
- package/dist/parser/recipe/botania/terraPlate.d.ts +4 -16
- package/dist/parser/recipe/botania/terraPlate.js +2 -25
- package/dist/parser/recipe/botania/terraPlate.js.map +1 -1
- package/dist/parser/recipe/create/assembly.d.ts +18 -17
- package/dist/parser/recipe/create/assembly.js +28 -28
- package/dist/parser/recipe/create/assembly.js.map +1 -1
- package/dist/parser/recipe/create/processing.d.ts +4 -16
- package/dist/parser/recipe/create/processing.js +2 -25
- package/dist/parser/recipe/create/processing.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cooking.d.ts +16 -12
- package/dist/parser/recipe/farmersdelight/cooking.js +27 -15
- package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cutting.d.ts +14 -15
- package/dist/parser/recipe/farmersdelight/cutting.js +32 -29
- package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -1
- package/dist/parser/recipe/forge/conditional.d.ts +11 -11
- package/dist/parser/recipe/forge/conditional.js +17 -21
- package/dist/parser/recipe/forge/conditional.js.map +1 -1
- package/dist/parser/recipe/index.d.ts +36 -13
- package/dist/parser/recipe/index.js +38 -5
- package/dist/parser/recipe/index.js.map +1 -1
- package/dist/parser/recipe/ingredientMap.d.ts +12 -0
- package/dist/parser/recipe/ingredientMap.js +17 -0
- package/dist/parser/recipe/ingredientMap.js.map +1 -0
- package/dist/parser/recipe/manyToMany.d.ts +20 -0
- package/dist/parser/recipe/manyToMany.js +33 -0
- package/dist/parser/recipe/manyToMany.js.map +1 -0
- package/dist/parser/recipe/manyToOne.d.ts +20 -0
- package/dist/parser/recipe/manyToOne.js +33 -0
- package/dist/parser/recipe/manyToOne.js.map +1 -0
- package/dist/parser/recipe/oneToOne.d.ts +20 -0
- package/dist/parser/recipe/oneToOne.js +33 -0
- package/dist/parser/recipe/oneToOne.js.map +1 -0
- package/dist/parser/recipe/roots/component.d.ts +13 -12
- package/dist/parser/recipe/roots/component.js +16 -11
- package/dist/parser/recipe/roots/component.js.map +1 -1
- package/dist/parser/recipe/roots/ritual.d.ts +14 -16
- package/dist/parser/recipe/roots/ritual.js +18 -25
- package/dist/parser/recipe/roots/ritual.js.map +1 -1
- package/dist/parser/recipe/sullys/polishing.d.ts +4 -16
- package/dist/parser/recipe/sullys/polishing.js +2 -25
- package/dist/parser/recipe/sullys/polishing.js.map +1 -1
- package/dist/parser/recipe/thermal/catalyst.d.ts +13 -12
- package/dist/parser/recipe/thermal/catalyst.js +16 -11
- package/dist/parser/recipe/thermal/catalyst.js.map +1 -1
- package/dist/parser/recipe/thermal/fuel.d.ts +13 -12
- package/dist/parser/recipe/thermal/fuel.js +17 -11
- package/dist/parser/recipe/thermal/fuel.js.map +1 -1
- package/dist/parser/recipe/thermal/index.d.ts +16 -14
- package/dist/parser/recipe/thermal/index.js +35 -24
- package/dist/parser/recipe/thermal/index.js.map +1 -1
- package/dist/parser/recipe/thermal/ingredient.d.ts +4 -21
- package/dist/parser/recipe/thermal/ingredient.js +40 -33
- package/dist/parser/recipe/thermal/ingredient.js.map +1 -1
- package/dist/parser/recipe/thermal/treeExtraction.d.ts +17 -17
- package/dist/parser/recipe/thermal/treeExtraction.js +30 -31
- package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -1
- package/dist/parser/recipe/vanilla/shaped.d.ts +17 -13
- package/dist/parser/recipe/vanilla/shaped.js +21 -16
- package/dist/parser/recipe/vanilla/shaped.js.map +1 -1
- package/dist/parser/recipe/vanilla/shapeless.d.ts +3 -17
- package/dist/parser/recipe/vanilla/shapeless.js +2 -25
- package/dist/parser/recipe/vanilla/shapeless.js.map +1 -1
- package/dist/parser/recipe/vanilla/smelting.d.ts +16 -13
- package/dist/parser/recipe/vanilla/smelting.js +21 -15
- package/dist/parser/recipe/vanilla/smelting.js.map +1 -1
- package/dist/parser/recipe/vanilla/smithing.d.ts +18 -14
- package/dist/parser/recipe/vanilla/smithing.js +25 -16
- package/dist/parser/recipe/vanilla/smithing.js.map +1 -1
- package/dist/parser/recipe/vanilla/stonecutting.d.ts +15 -13
- package/dist/parser/recipe/vanilla/stonecutting.js +22 -24
- package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -1
- package/dist/parser/roots.d.ts +2 -4
- package/dist/parser/roots.js +2 -2
- package/dist/parser/roots.js.map +1 -1
- package/dist/parser/thermal.d.ts +4 -10
- package/dist/parser/thermal.js +4 -5
- package/dist/parser/thermal.js.map +1 -1
- package/dist/schema/data/recipe.d.ts +2 -1
- package/package.json +2 -1
- package/dist/common/ingredient.d.ts +0 -49
- package/dist/common/ingredient.js +0 -108
- package/dist/common/ingredient.js.map +0 -1
- package/dist/common/result.d.ts +0 -48
- package/dist/common/result.js +0 -37
- package/dist/common/result.js.map +0 -1
- package/dist/parser/recipe/adAstra/index.d.ts +0 -5
- package/dist/parser/recipe/adAstra/index.js +0 -1
- package/dist/parser/recipe/adAstra/index.js.map +0 -1
- package/dist/parser/recipe/ignored.d.ts +0 -10
- package/dist/parser/recipe/ignored.js +0 -16
- package/dist/parser/recipe/ignored.js.map +0 -1
- package/dist/parser/recipe/quark/exclusion.d.ts +0 -20
- package/dist/parser/recipe/quark/exclusion.js +0 -32
- package/dist/parser/recipe/quark/exclusion.js.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import RecipeParser, { Recipe, } from "./index.js";
|
|
2
|
+
export class OneToOneRecipe extends Recipe {
|
|
3
|
+
ingredient;
|
|
4
|
+
result;
|
|
5
|
+
constructor(ingredient, result) {
|
|
6
|
+
super();
|
|
7
|
+
this.ingredient = ingredient;
|
|
8
|
+
this.result = result;
|
|
9
|
+
}
|
|
10
|
+
getIngredients() {
|
|
11
|
+
return [this.ingredient];
|
|
12
|
+
}
|
|
13
|
+
getResults() {
|
|
14
|
+
return [this.result];
|
|
15
|
+
}
|
|
16
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
17
|
+
return new OneToOneRecipe(ingredientReplacer(this.ingredient), resultReplacer(this.result));
|
|
18
|
+
}
|
|
19
|
+
serialize(context) {
|
|
20
|
+
return {
|
|
21
|
+
result: context.results.serialize(this.result),
|
|
22
|
+
ingredient: context.ingredients.serialize(this.ingredient),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export class OneToOneRecipeParser extends RecipeParser {
|
|
27
|
+
deserialize(definition, context) {
|
|
28
|
+
const ingredient = context.ingredients.create(definition.ingredient);
|
|
29
|
+
const result = context.results.create(definition.result);
|
|
30
|
+
return new OneToOneRecipe(ingredient, result);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=oneToOne.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oneToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/oneToOne.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,cAAe,SAAQ,MAAM;IAEnB;IACA;IAFrB,YACqB,UAAsB,EACtB,MAAc;QAEjC,KAAK,EAAE,CAAC;QAHW,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGnC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,cAAc,CACvB,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,oBAEX,SAAQ,YAAyC;IACjD,WAAW,CACT,UAAuB,EACvB,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
4
2
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
3
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
5
|
export type RootComponentRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
6
|
effect: string;
|
|
8
|
-
ingredients:
|
|
7
|
+
ingredients: unknown[];
|
|
9
8
|
}>;
|
|
10
|
-
export declare class RootComponentRecipe extends Recipe
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export declare class RootComponentRecipe extends Recipe {
|
|
10
|
+
private readonly ingredients;
|
|
11
|
+
constructor(ingredients: Ingredient[]);
|
|
12
|
+
getIngredients(): Ingredient[];
|
|
13
|
+
getResults(): never[];
|
|
14
|
+
replace(ingredientReplacer: Replacer<Ingredient>): RootComponentRecipe;
|
|
15
|
+
serialize(context: RecipeParseContext): Partial<RootComponentRecipeDefinition>;
|
|
15
16
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
17
|
+
export declare class RootComponentRecipeParser extends RecipeParser<RootComponentRecipeDefinition, RootComponentRecipe> {
|
|
18
|
+
deserialize(definition: RootComponentRecipeDefinition, context: RecipeParseContext): RootComponentRecipe;
|
|
18
19
|
}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class RootComponentRecipe extends Recipe {
|
|
3
|
+
ingredients;
|
|
4
|
+
constructor(ingredients) {
|
|
5
|
+
super();
|
|
6
|
+
this.ingredients = ingredients;
|
|
7
|
+
}
|
|
3
8
|
getIngredients() {
|
|
4
|
-
return this.
|
|
9
|
+
return this.ingredients;
|
|
5
10
|
}
|
|
6
11
|
getResults() {
|
|
7
12
|
return [];
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
return new RootComponentRecipe(
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
-
});
|
|
14
|
+
replace(ingredientReplacer) {
|
|
15
|
+
return new RootComponentRecipe(this.ingredients.map(ingredientReplacer));
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
+
serialize(context) {
|
|
18
|
+
return {
|
|
19
|
+
ingredients: context.ingredients.serializeList(this.ingredients),
|
|
20
|
+
};
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
export class RootComponentRecipeParser extends RecipeParser {
|
|
24
|
+
deserialize(definition, context) {
|
|
25
|
+
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
26
|
+
return new RootComponentRecipe(ingredients);
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/component.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,mBAAoB,SAAQ,MAAM;IAChB;IAA7B,YAA6B,WAAyB;QACpD,KAAK,EAAE,CAAC;QADmB,gBAAW,GAAX,WAAW,CAAc;IAEtD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,kBAAwC;QACvD,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,YAG9C;IACC,WAAW,CACT,UAAyC,EACzC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,OAAO,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import type { Ingredient
|
|
2
|
-
import type { Result
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
export type RootRitualRecipeDefinition =
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
3
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import RecipeParser from "../index.js";
|
|
5
|
+
import { ManyToOneRecipe, type ManyToOneRecipeDefinition } from "../manyToOne.js";
|
|
6
|
+
export type RootRitualRecipeDefinition = ManyToOneRecipeDefinition & Readonly<{
|
|
7
7
|
color: string;
|
|
8
8
|
effect: string;
|
|
9
9
|
level: number;
|
|
10
|
-
incenses?:
|
|
11
|
-
ingredients?: Ingredient[];
|
|
12
|
-
result?: Result;
|
|
10
|
+
incenses?: unknown[];
|
|
13
11
|
}>;
|
|
14
|
-
export declare class RootRitualRecipe extends
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
export declare class RootRitualRecipe extends ManyToOneRecipe {
|
|
13
|
+
private readonly incenses;
|
|
14
|
+
constructor(ingredients: Ingredient[], result: Result, incenses?: Ingredient[]);
|
|
15
|
+
getIngredients(): Ingredient[];
|
|
16
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): RootRitualRecipe;
|
|
19
17
|
}
|
|
20
|
-
export
|
|
21
|
-
|
|
18
|
+
export declare class RootRitualRecipeParser extends RecipeParser<RootRitualRecipeDefinition, RootRitualRecipe> {
|
|
19
|
+
deserialize(definition: RootRitualRecipeDefinition, context: RecipeParseContext): RootRitualRecipe;
|
|
22
20
|
}
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export class RootRitualRecipe extends
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
];
|
|
9
|
-
}
|
|
10
|
-
getResults() {
|
|
11
|
-
return [this.definition.result].filter(exists);
|
|
1
|
+
import RecipeParser from "../index.js";
|
|
2
|
+
import { ManyToOneRecipe, } from "../manyToOne.js";
|
|
3
|
+
export class RootRitualRecipe extends ManyToOneRecipe {
|
|
4
|
+
incenses;
|
|
5
|
+
constructor(ingredients, result, incenses = []) {
|
|
6
|
+
super(ingredients, result);
|
|
7
|
+
this.incenses = incenses;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
...this.definition,
|
|
16
|
-
ingredients: this.definition.ingredients?.map(replace),
|
|
17
|
-
incenses: this.definition.incenses?.map(replace),
|
|
18
|
-
});
|
|
9
|
+
getIngredients() {
|
|
10
|
+
return [...super.getIngredients(), ...this.incenses];
|
|
19
11
|
}
|
|
20
|
-
|
|
21
|
-
return new RootRitualRecipe(
|
|
22
|
-
...this.definition,
|
|
23
|
-
result: this.definition.result && replace(this.definition.result),
|
|
24
|
-
});
|
|
12
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
13
|
+
return new RootRitualRecipe(this.incenses.map(ingredientReplacer), resultReplacer(this.result), this.incenses.map(ingredientReplacer));
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
export class RootRitualRecipeParser extends RecipeParser {
|
|
17
|
+
deserialize(definition, context) {
|
|
18
|
+
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
19
|
+
const result = context.results.create(definition.result);
|
|
20
|
+
const incenses = definition.incenses &&
|
|
21
|
+
context.ingredients.createList(definition.incenses);
|
|
22
|
+
return new RootRitualRecipe(ingredients, result, incenses);
|
|
30
23
|
}
|
|
31
24
|
}
|
|
32
25
|
//# sourceMappingURL=ritual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ritual.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/ritual.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ritual.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/ritual.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AAUzB,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAIhC;IAHnB,YACE,WAAyB,EACzB,MAAc,EACG,WAAyB,EAAE;QAE5C,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFV,aAAQ,GAAR,QAAQ,CAAmB;IAG9C,CAAC;IAEQ,cAAc;QACrB,OAAO,CAAC,GAAG,KAAK,CAAC,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACrC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CACtC,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,QAAQ,GACZ,UAAU,CAAC,QAAQ;YACnB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtD,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import type { Replacer } from "../index.js";
|
|
5
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
6
|
-
export type GrindstonePolishingDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredients: Ingredient[];
|
|
8
|
-
result: Result;
|
|
1
|
+
import type { ManyToOneRecipeDefinition } from "../manyToOne.js";
|
|
2
|
+
import { ManyToOneRecipeParser } from "../manyToOne.js";
|
|
3
|
+
export type GrindstonePolishingDefinition = ManyToOneRecipeDefinition & Readonly<{
|
|
9
4
|
experience?: number;
|
|
10
5
|
}>;
|
|
11
|
-
export declare class
|
|
12
|
-
getIngredients(): IngredientInput[];
|
|
13
|
-
getResults(): ResultInput[];
|
|
14
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
15
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
16
|
-
}
|
|
17
|
-
export default class GrindstonePolishingParser extends RecipeParser<GrindstonePolishingDefinition, GrindstonePolishing> {
|
|
18
|
-
create(definition: GrindstonePolishingDefinition): GrindstonePolishing;
|
|
6
|
+
export declare class GrindstonePolishingParser extends ManyToOneRecipeParser<GrindstonePolishingDefinition> {
|
|
19
7
|
}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export class
|
|
3
|
-
getIngredients() {
|
|
4
|
-
return this.definition.ingredients;
|
|
5
|
-
}
|
|
6
|
-
getResults() {
|
|
7
|
-
return [this.definition.result];
|
|
8
|
-
}
|
|
9
|
-
replaceIngredient(replace) {
|
|
10
|
-
return new GrindstonePolishing({
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
replaceResult(replace) {
|
|
16
|
-
return new GrindstonePolishing({
|
|
17
|
-
...this.definition,
|
|
18
|
-
result: replace(this.definition.result),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export default class GrindstonePolishingParser extends RecipeParser {
|
|
23
|
-
create(definition) {
|
|
24
|
-
return new GrindstonePolishing(definition);
|
|
25
|
-
}
|
|
1
|
+
import { ManyToOneRecipeParser } from "../manyToOne.js";
|
|
2
|
+
export class GrindstonePolishingParser extends ManyToOneRecipeParser {
|
|
26
3
|
}
|
|
27
4
|
//# sourceMappingURL=polishing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polishing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/sullys/polishing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"polishing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/sullys/polishing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAOxD,MAAM,OAAO,yBAA0B,SAAQ,qBAAoD;CAAG"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
4
2
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
3
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
5
|
export type ThermalCatalystRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredient:
|
|
6
|
+
ingredient: unknown;
|
|
8
7
|
primary_mod?: number;
|
|
9
8
|
secondary_mod?: number;
|
|
10
9
|
energy_mod?: number;
|
|
11
10
|
min_chance?: number;
|
|
12
11
|
use_chance?: number;
|
|
13
12
|
}>;
|
|
14
|
-
export declare class ThermalCatalystRecipe extends Recipe
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export declare class ThermalCatalystRecipe extends Recipe {
|
|
14
|
+
private readonly ingredient;
|
|
15
|
+
constructor(ingredient: Ingredient);
|
|
16
|
+
getIngredients(): Ingredient[];
|
|
17
|
+
getResults(): never[];
|
|
18
|
+
replace(ingredientReplacer: Replacer<Ingredient>): Recipe;
|
|
19
|
+
serialize(context: RecipeParseContext): Partial<ThermalCatalystRecipeDefinition>;
|
|
19
20
|
}
|
|
20
|
-
export
|
|
21
|
-
|
|
21
|
+
export declare class ThermalCatalystRecipeParser extends RecipeParser<ThermalCatalystRecipeDefinition, ThermalCatalystRecipe> {
|
|
22
|
+
deserialize(definition: ThermalCatalystRecipeDefinition, context: RecipeParseContext): ThermalCatalystRecipe;
|
|
22
23
|
}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class ThermalCatalystRecipe extends Recipe {
|
|
3
|
+
ingredient;
|
|
4
|
+
constructor(ingredient) {
|
|
5
|
+
super();
|
|
6
|
+
this.ingredient = ingredient;
|
|
7
|
+
}
|
|
3
8
|
getIngredients() {
|
|
4
|
-
return [this.
|
|
9
|
+
return [this.ingredient];
|
|
5
10
|
}
|
|
6
11
|
getResults() {
|
|
7
12
|
return [];
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
return new ThermalCatalystRecipe(
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredient: replace(this.definition.ingredient),
|
|
13
|
-
});
|
|
14
|
+
replace(ingredientReplacer) {
|
|
15
|
+
return new ThermalCatalystRecipe(ingredientReplacer(this.ingredient));
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
+
serialize(context) {
|
|
18
|
+
return {
|
|
19
|
+
ingredient: context.ingredients.serialize(this.ingredient),
|
|
20
|
+
};
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
export class ThermalCatalystRecipeParser extends RecipeParser {
|
|
24
|
+
deserialize(definition, context) {
|
|
25
|
+
const ingredient = context.ingredients.create(definition.ingredient);
|
|
26
|
+
return new ThermalCatalystRecipe(ingredient);
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
//# sourceMappingURL=catalyst.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalyst.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/catalyst.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"catalyst.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/catalyst.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,qBAAsB,SAAQ,MAAM;IAClB;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,kBAAwC;QACvD,OAAO,IAAI,qBAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACxE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,YAGhD;IACC,WAAW,CACT,UAA2C,EAC3C,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
4
2
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
3
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
5
|
export type ThermalFuelRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
6
|
energy: number;
|
|
8
|
-
ingredient:
|
|
7
|
+
ingredient: unknown;
|
|
9
8
|
}>;
|
|
10
|
-
export declare class ThermalFuelRecipe extends Recipe
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export declare class ThermalFuelRecipe extends Recipe {
|
|
10
|
+
private readonly ingredient;
|
|
11
|
+
constructor(ingredient: Ingredient);
|
|
12
|
+
getIngredients(): Ingredient[];
|
|
13
|
+
getResults(): never[];
|
|
14
|
+
replace(ingredientReplacer: Replacer<Ingredient>): Recipe;
|
|
15
|
+
serialize(context: RecipeParseContext): Partial<ThermalFuelRecipeDefinition>;
|
|
15
16
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
17
|
+
export declare class ThermalFuelRecipeParser extends RecipeParser<ThermalFuelRecipeDefinition, ThermalFuelRecipe> {
|
|
18
|
+
deserialize(definition: ThermalFuelRecipeDefinition, context: RecipeParseContext): ThermalFuelRecipe;
|
|
18
19
|
}
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
// TODO could be same as catalyst
|
|
2
3
|
export class ThermalFuelRecipe extends Recipe {
|
|
4
|
+
ingredient;
|
|
5
|
+
constructor(ingredient) {
|
|
6
|
+
super();
|
|
7
|
+
this.ingredient = ingredient;
|
|
8
|
+
}
|
|
3
9
|
getIngredients() {
|
|
4
|
-
return [this.
|
|
10
|
+
return [this.ingredient];
|
|
5
11
|
}
|
|
6
12
|
getResults() {
|
|
7
13
|
return [];
|
|
8
14
|
}
|
|
9
|
-
|
|
10
|
-
return new ThermalFuelRecipe(
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredient: replace(this.definition.ingredient),
|
|
13
|
-
});
|
|
15
|
+
replace(ingredientReplacer) {
|
|
16
|
+
return new ThermalFuelRecipe(ingredientReplacer(this.ingredient));
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
return
|
|
18
|
+
serialize(context) {
|
|
19
|
+
return {
|
|
20
|
+
ingredient: context.ingredients.serialize(this.ingredient),
|
|
21
|
+
};
|
|
17
22
|
}
|
|
18
23
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
export class ThermalFuelRecipeParser extends RecipeParser {
|
|
25
|
+
deserialize(definition, context) {
|
|
26
|
+
const ingredient = context.ingredients.create(definition.ingredient);
|
|
27
|
+
return new ThermalFuelRecipe(ingredient);
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
//# sourceMappingURL=fuel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fuel.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/fuel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fuel.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/fuel.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,iCAAiC;AACjC,MAAM,OAAO,iBAAkB,SAAQ,MAAM;IACd;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,kBAAwC;QACvD,OAAO,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACpE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,YAG5C;IACC,WAAW,CACT,UAAuC,EACvC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import type { Ingredient
|
|
2
|
-
import type { Result
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
3
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
-
import type { Replacer } from "../index.js";
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
5
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
6
|
-
import type { ThermalIngredientInput } from "./ingredient.js";
|
|
7
6
|
export type ThermalRecipeDefinition = RecipeDefinition & Readonly<{
|
|
8
|
-
ingredient?:
|
|
9
|
-
ingredients?:
|
|
10
|
-
result:
|
|
7
|
+
ingredient?: unknown;
|
|
8
|
+
ingredients?: unknown[];
|
|
9
|
+
result: unknown;
|
|
11
10
|
energy?: number;
|
|
12
11
|
experience?: number;
|
|
13
12
|
}>;
|
|
14
|
-
export declare class ThermalRecipe extends Recipe
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export declare class ThermalRecipe extends Recipe {
|
|
14
|
+
private readonly ingredients;
|
|
15
|
+
private readonly results;
|
|
16
|
+
constructor(ingredients: Ingredient[], results: Result[]);
|
|
17
|
+
getIngredients(): Ingredient[];
|
|
18
|
+
getResults(): Result[];
|
|
19
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): Recipe;
|
|
20
|
+
serialize(context: RecipeParseContext): Partial<ThermalRecipeDefinition>;
|
|
19
21
|
}
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
+
export declare class ThermalRecipeParser extends RecipeParser<ThermalRecipeDefinition, ThermalRecipe> {
|
|
23
|
+
deserialize(definition: ThermalRecipeDefinition, context: RecipeParseContext): ThermalRecipe;
|
|
22
24
|
}
|
|
@@ -1,36 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IllegalShapeError } from "../../../error.js";
|
|
2
2
|
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import { fromThermalIngredient, toThermalIngredient } from "./ingredient.js";
|
|
4
3
|
export class ThermalRecipe extends Recipe {
|
|
4
|
+
ingredients;
|
|
5
|
+
results;
|
|
6
|
+
constructor(ingredients, results) {
|
|
7
|
+
super();
|
|
8
|
+
this.ingredients = ingredients;
|
|
9
|
+
this.results = results;
|
|
10
|
+
}
|
|
5
11
|
getIngredients() {
|
|
6
|
-
return
|
|
7
|
-
.filter(exists)
|
|
8
|
-
.map(fromThermalIngredient);
|
|
12
|
+
return this.ingredients;
|
|
9
13
|
}
|
|
10
14
|
getResults() {
|
|
11
|
-
return
|
|
15
|
+
return this.results;
|
|
12
16
|
}
|
|
13
|
-
|
|
14
|
-
return new ThermalRecipe(
|
|
15
|
-
...this.definition,
|
|
16
|
-
ingredient: this.definition.ingredient &&
|
|
17
|
-
toThermalIngredient(replace(fromThermalIngredient(this.definition.ingredient))),
|
|
18
|
-
ingredients: this.definition.ingredients
|
|
19
|
-
?.map(fromThermalIngredient)
|
|
20
|
-
?.map(replace)
|
|
21
|
-
?.map(toThermalIngredient),
|
|
22
|
-
});
|
|
17
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
18
|
+
return new ThermalRecipe(this.ingredients.map(ingredientReplacer), this.results.map(resultReplacer));
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
serialize(context) {
|
|
21
|
+
const serialized = {
|
|
22
|
+
result: context.results.serializeList(this.results),
|
|
23
|
+
};
|
|
24
|
+
if (this.ingredients.length === 1) {
|
|
25
|
+
serialized.ingredient = context.ingredients.serialize(this.ingredients[0]);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
serialized.ingredients = context.ingredients.serializeList(this.ingredients);
|
|
29
|
+
}
|
|
30
|
+
return serialized;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
export class ThermalRecipeParser extends RecipeParser {
|
|
34
|
+
deserialize(definition, context) {
|
|
35
|
+
// TODO map from and to thermals shape
|
|
36
|
+
const ingredients = definition.ingredient
|
|
37
|
+
? [context.ingredients.create(definition.ingredient)]
|
|
38
|
+
: context.ingredients.createList(definition.ingredients ?? []);
|
|
39
|
+
if (ingredients.length === 0)
|
|
40
|
+
throw new IllegalShapeError("ingredients missing or empty", definition);
|
|
41
|
+
const results = Array.isArray(definition.result)
|
|
42
|
+
? context.results.createList(definition.result)
|
|
43
|
+
: [context.results.create(definition.result)];
|
|
44
|
+
return new ThermalRecipe(ingredients, results);
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWnD,MAAM,OAAO,aAAc,SAAQ,MAAM;IAEpB;IACA;IAFnB,YACmB,WAAyB,EACzB,OAAiB;QAElC,KAAK,EAAE,CAAC;QAHS,gBAAW,GAAX,WAAW,CAAc;QACzB,YAAO,GAAP,OAAO,CAAU;IAGpC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,OAAO,CACL,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,aAAa,CACtB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACxC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CACjC,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,MAAM,UAAU,GAAgD;YAC9D,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC;SACpD,CAAC;QAEF,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAClC,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CACnD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAE,CACrB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,CACxD,IAAI,CAAC,WAAW,CACjB,CAAC;QACJ,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,YAGxC;IACC,WAAW,CACT,UAAmC,EACnC,OAA2B;QAE3B,sCAAsC;QAEtC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU;YACvC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YACrD,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QAEjE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,IAAI,iBAAiB,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC;QAE1E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YAC9C,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;YAC/C,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAEhD,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF"}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
amount: zod.ZodNumber;
|
|
6
|
-
}, "strip", zod.ZodTypeAny, {
|
|
7
|
-
amount: number;
|
|
8
|
-
fluid_tag: string;
|
|
9
|
-
}, {
|
|
10
|
-
amount: number;
|
|
11
|
-
fluid_tag: string;
|
|
12
|
-
}>;
|
|
13
|
-
type ThermalFluidTag = zod.infer<typeof ThermalFluidTagSchema>;
|
|
14
|
-
type ThermalItemList = Readonly<{
|
|
15
|
-
value: ThermalIngredientInput[];
|
|
16
|
-
count?: number;
|
|
17
|
-
}>;
|
|
18
|
-
export type ThermalIngredientInput = Exclude<IngredientInput, FluidTag> | ThermalFluidTag | ThermalItemList;
|
|
19
|
-
export declare function fromThermalIngredient(input: ThermalIngredientInput): Ingredient;
|
|
20
|
-
export declare function toThermalIngredient(input: IngredientInput): ThermalIngredientInput;
|
|
21
|
-
export {};
|
|
1
|
+
import { type Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type IngredientSerializer from "../../../common/ingredient/serializer.js";
|
|
3
|
+
export declare function createThermalIngredients(ingredients: IngredientSerializer, input: unknown): Ingredient[];
|
|
4
|
+
export declare function serializeThermalIngredient(ingredients: IngredientSerializer, ingredient: Ingredient): unknown;
|