@adeficior/data-modifier 1.0.0-rc.11 → 1.0.0-rc.13
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 -7
- package/dist/emit/data/loot.js +14 -13
- package/dist/emit/data/loot.js.map +1 -1
- package/dist/emit/data/recipe.d.ts +18 -16
- package/dist/emit/data/recipe.js +28 -22
- 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 +4 -2
- 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 +1 -4
- package/dist/index.js +1 -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 +15 -8
- package/dist/loader/pack.js +43 -25
- package/dist/loader/pack.js.map +1 -1
- package/dist/loader/recipe.d.ts +8 -4
- package/dist/loader/recipe.js +41 -47
- 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/packFormat.d.ts +11 -0
- package/dist/packFormat.js +59 -0
- package/dist/packFormat.js.map +1 -0
- 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 +6 -12
- package/dist/parser/index.js +6 -6
- 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 +26 -19
- 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 +12 -13
- 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 +10 -11
- 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 +27 -27
- 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 -14
- 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 +10 -10
- package/dist/parser/recipe/forge/conditional.js +13 -17
- package/dist/parser/recipe/forge/conditional.js.map +1 -1
- package/dist/parser/recipe/index.d.ts +21 -12
- package/dist/parser/recipe/index.js +10 -3
- 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 -15
- 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 +29 -30
- 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 +3 -2
- 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
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
1
|
+
import type { BlockId } from "@adeficior/data-modifier/generated";
|
|
2
|
+
import { type Ingredient } from "../../../common/ingredient/index.js";
|
|
3
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
4
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import
|
|
6
|
-
type ExtractionBlockInput = string;
|
|
5
|
+
import RecipeParser, { Recipe, type RecipeParseContext, type Replacer } from "../index.js";
|
|
7
6
|
export type TreeExtractionRecipeDefinition = RecipeDefinition & Readonly<{
|
|
8
|
-
leaves:
|
|
9
|
-
trunk:
|
|
10
|
-
result:
|
|
7
|
+
leaves: BlockId;
|
|
8
|
+
trunk: BlockId;
|
|
9
|
+
result: unknown;
|
|
11
10
|
}>;
|
|
12
|
-
export declare class TreeExtractionRecipe extends Recipe
|
|
11
|
+
export declare class TreeExtractionRecipe extends Recipe {
|
|
13
12
|
private readonly trunk;
|
|
14
13
|
private readonly leaves;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
private readonly result;
|
|
15
|
+
constructor(definition: RecipeDefinition, trunk: Ingredient, leaves: Ingredient, result: Result);
|
|
16
|
+
getIngredients(): Ingredient[];
|
|
17
|
+
getResults(): Result[];
|
|
18
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): TreeExtractionRecipe;
|
|
19
|
+
private serializeBlockIngredient;
|
|
20
|
+
serialize(context: RecipeParseContext): Partial<TreeExtractionRecipeDefinition>;
|
|
20
21
|
}
|
|
21
|
-
export
|
|
22
|
-
|
|
22
|
+
export declare class TreeExtractionRecipeParser extends RecipeParser<TreeExtractionRecipeDefinition, TreeExtractionRecipe> {
|
|
23
|
+
deserialize(definition: TreeExtractionRecipeDefinition, context: RecipeParseContext): TreeExtractionRecipe;
|
|
23
24
|
}
|
|
24
|
-
export {};
|
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { encodeId } from "../../../common/id.js";
|
|
2
|
+
import { BlockIngredient, } from "../../../common/ingredient/index.js";
|
|
2
3
|
import { IllegalShapeError } from "../../../error.js";
|
|
3
|
-
|
|
4
|
-
if (typeof input !== "string")
|
|
5
|
-
throw new IllegalShapeError("unknown block input shape", input);
|
|
6
|
-
return {
|
|
7
|
-
block: input,
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function ingredientToBlock(input) {
|
|
11
|
-
if (input && typeof input === "object") {
|
|
12
|
-
if ("block" in input)
|
|
13
|
-
return input.block;
|
|
14
|
-
}
|
|
15
|
-
throw new IllegalShapeError("unknown block input shape", input);
|
|
16
|
-
}
|
|
4
|
+
import RecipeParser, { Recipe, } from "../index.js";
|
|
17
5
|
export class TreeExtractionRecipe extends Recipe {
|
|
18
6
|
trunk;
|
|
19
7
|
leaves;
|
|
20
|
-
|
|
8
|
+
result;
|
|
9
|
+
constructor(definition, trunk, leaves, result) {
|
|
21
10
|
super(definition);
|
|
22
|
-
this.trunk =
|
|
23
|
-
this.leaves =
|
|
11
|
+
this.trunk = trunk;
|
|
12
|
+
this.leaves = leaves;
|
|
13
|
+
this.result = result;
|
|
24
14
|
}
|
|
25
15
|
getIngredients() {
|
|
26
16
|
return [this.trunk, this.leaves];
|
|
27
17
|
}
|
|
28
18
|
getResults() {
|
|
29
|
-
return [];
|
|
19
|
+
return [this.result];
|
|
20
|
+
}
|
|
21
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
22
|
+
return new TreeExtractionRecipe(this.definition, ingredientReplacer(this.trunk), ingredientReplacer(this.leaves), resultReplacer(this.result));
|
|
30
23
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
24
|
+
serializeBlockIngredient(ingredient) {
|
|
25
|
+
if (ingredient instanceof BlockIngredient) {
|
|
26
|
+
return encodeId(ingredient.id);
|
|
27
|
+
}
|
|
28
|
+
throw new IllegalShapeError("tree extraction recipes ingredients need to be blocks", ingredient);
|
|
37
29
|
}
|
|
38
|
-
|
|
39
|
-
return
|
|
30
|
+
serialize(context) {
|
|
31
|
+
return {
|
|
32
|
+
result: context.results.serialize(this.result),
|
|
33
|
+
trunk: this.serializeBlockIngredient(this.trunk),
|
|
34
|
+
leaves: this.serializeBlockIngredient(this.leaves),
|
|
35
|
+
};
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
export class TreeExtractionRecipeParser extends RecipeParser {
|
|
39
|
+
deserialize(definition, context) {
|
|
40
|
+
const trunk = context.ingredients.create(new BlockIngredient(definition.trunk));
|
|
41
|
+
const leaves = context.ingredients.create(new BlockIngredient(definition.leaves));
|
|
42
|
+
const result = context.results.create(definition.result);
|
|
43
|
+
return new TreeExtractionRecipe(definition, trunk, leaves, result);
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
//# sourceMappingURL=treeExtraction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeExtraction.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/treeExtraction.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"treeExtraction.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/treeExtraction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,eAAe,GAEhB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,aAAa,CAAC;AASrB,MAAM,OAAO,oBAAqB,SAAQ,MAAM;IAG3B;IACA;IACA;IAJnB,YACE,UAA4B,EACX,KAAiB,EACjB,MAAkB,EAClB,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAJD,UAAK,GAAL,KAAK,CAAY;QACjB,WAAM,GAAN,MAAM,CAAY;QAClB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,oBAAoB,CAC7B,IAAI,CAAC,UAAU,EACf,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAC9B,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/B,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,UAAsB;QACrD,IAAI,UAAU,YAAY,eAAe,EAAE,CAAC;YAC1C,OAAO,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,iBAAiB,CACzB,uDAAuD,EACvD,UAAU,CACX,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,KAAK,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC;YAChD,MAAM,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,0BAA2B,SAAQ,YAG/C;IACC,WAAW,CACT,UAA0C,EAC1C,OAA2B;QAE3B,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CACtC,IAAI,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CACtC,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CACvC,IAAI,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CACvC,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,oBAAoB,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
|
+
import type { IngredientMap, IngredientMapInput } from "../ingredientMap.js";
|
|
6
7
|
export type ShapedRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
key:
|
|
8
|
+
key: IngredientMapInput;
|
|
8
9
|
pattern: string[];
|
|
9
|
-
result:
|
|
10
|
+
result: unknown;
|
|
10
11
|
}>;
|
|
11
|
-
export declare class ShapedRecipe extends Recipe
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export declare class ShapedRecipe extends Recipe {
|
|
13
|
+
private readonly ingredients;
|
|
14
|
+
private readonly result;
|
|
15
|
+
constructor(definition: RecipeDefinition, ingredients: IngredientMap, result: Result);
|
|
16
|
+
getIngredients(): Ingredient[];
|
|
17
|
+
getResults(): Result[];
|
|
18
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ShapedRecipe;
|
|
19
|
+
serialize(context: RecipeParseContext): Partial<ShapedRecipeDefinition>;
|
|
16
20
|
}
|
|
17
|
-
export
|
|
18
|
-
|
|
21
|
+
export declare class ShapedParser extends RecipeParser<ShapedRecipeDefinition, ShapedRecipe> {
|
|
22
|
+
deserialize(definition: ShapedRecipeDefinition, context: RecipeParseContext): ShapedRecipe;
|
|
19
23
|
}
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
-
import { mapValues } from "lodash-es";
|
|
3
2
|
export class ShapedRecipe extends Recipe {
|
|
3
|
+
ingredients;
|
|
4
|
+
result;
|
|
5
|
+
constructor(definition, ingredients, result) {
|
|
6
|
+
super(definition);
|
|
7
|
+
this.ingredients = ingredients;
|
|
8
|
+
this.result = result;
|
|
9
|
+
}
|
|
4
10
|
getIngredients() {
|
|
5
|
-
return
|
|
11
|
+
return this.ingredients.list();
|
|
6
12
|
}
|
|
7
13
|
getResults() {
|
|
8
|
-
return [this.
|
|
14
|
+
return [this.result];
|
|
9
15
|
}
|
|
10
|
-
|
|
11
|
-
return new ShapedRecipe(
|
|
12
|
-
...this.definition,
|
|
13
|
-
key: mapValues(this.definition.key, replace),
|
|
14
|
-
});
|
|
16
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
17
|
+
return new ShapedRecipe(this.definition, this.ingredients.replace(ingredientReplacer), resultReplacer(this.result));
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
result:
|
|
20
|
-
}
|
|
19
|
+
serialize(context) {
|
|
20
|
+
return {
|
|
21
|
+
key: this.ingredients.serialize(context),
|
|
22
|
+
result: context.results.serialize(this.result),
|
|
23
|
+
};
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
export class ShapedParser extends RecipeParser {
|
|
27
|
+
deserialize(definition, context) {
|
|
28
|
+
const ingredients = context.ingredients.ingredientMap(definition.key);
|
|
29
|
+
const result = context.results.create(definition.result);
|
|
30
|
+
return new ShapedRecipe(definition, ingredients, result);
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
//# sourceMappingURL=shaped.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shaped.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/shaped.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shaped.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/shaped.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUnD,MAAM,OAAO,YAAa,SAAQ,MAAM;IAGnB;IACA;IAHnB,YACE,UAA4B,EACX,WAA0B,EAC1B,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAHD,gBAAW,GAAX,WAAW,CAAe;QAC1B,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,CACL,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,YAAY,CACrB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAC5C,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC;YACxC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,YAGjC;IACC,WAAW,CACT,UAAkC,EAClC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,YAAY,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type { Result, ResultInput } from "../../../common/result.js";
|
|
6
|
-
export type ShapelessRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredients: Ingredient[];
|
|
8
|
-
result: Result;
|
|
9
|
-
}>;
|
|
10
|
-
export declare class ShapelessRecipe extends Recipe<ShapelessRecipeDefinition> {
|
|
11
|
-
getIngredients(): IngredientInput[];
|
|
12
|
-
getResults(): ResultInput[];
|
|
13
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
14
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
15
|
-
}
|
|
16
|
-
export default class ShapelessParser extends RecipeParser<ShapelessRecipeDefinition, ShapelessRecipe> {
|
|
17
|
-
create(definition: ShapelessRecipeDefinition): ShapelessRecipe;
|
|
1
|
+
import { ManyToOneRecipeParser, type ManyToOneRecipeDefinition } from "../manyToOne.js";
|
|
2
|
+
export type ShapelessRecipeDefinition = ManyToOneRecipeDefinition;
|
|
3
|
+
export declare class ShapelessParser extends ManyToOneRecipeParser<ShapelessRecipeDefinition> {
|
|
18
4
|
}
|
|
@@ -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 ShapelessRecipe({
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
replaceResult(replace) {
|
|
16
|
-
return new ShapelessRecipe({
|
|
17
|
-
...this.definition,
|
|
18
|
-
result: replace(this.definition.result),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export default class ShapelessParser extends RecipeParser {
|
|
23
|
-
create(definition) {
|
|
24
|
-
return new ShapelessRecipe(definition);
|
|
25
|
-
}
|
|
1
|
+
import { ManyToOneRecipeParser, } from "../manyToOne.js";
|
|
2
|
+
export class ShapelessParser extends ManyToOneRecipeParser {
|
|
26
3
|
}
|
|
27
4
|
//# sourceMappingURL=shapeless.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapeless.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/shapeless.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shapeless.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/shapeless.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,OAAO,eAAgB,SAAQ,qBAAgD;CAAG"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type SmeltingRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredient:
|
|
8
|
-
result:
|
|
7
|
+
ingredient: unknown;
|
|
8
|
+
result: unknown;
|
|
9
9
|
experience?: number;
|
|
10
10
|
}>;
|
|
11
|
-
export declare class SmeltingRecipe extends Recipe
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
export declare class SmeltingRecipe extends Recipe {
|
|
12
|
+
private readonly ingredient;
|
|
13
|
+
private readonly result;
|
|
14
|
+
constructor(definition: RecipeDefinition, ingredient: Ingredient, result: Result);
|
|
15
|
+
getIngredients(): Ingredient[];
|
|
16
|
+
getResults(): Result[];
|
|
17
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): SmeltingRecipe;
|
|
18
|
+
serialize(context: RecipeParseContext): Partial<SmeltingRecipeDefinition>;
|
|
16
19
|
}
|
|
17
|
-
export
|
|
18
|
-
|
|
20
|
+
export declare class SmeltingParser extends RecipeParser<SmeltingRecipeDefinition, SmeltingRecipe> {
|
|
21
|
+
deserialize(definition: SmeltingRecipeDefinition, context: RecipeParseContext): SmeltingRecipe;
|
|
19
22
|
}
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class SmeltingRecipe extends Recipe {
|
|
3
|
+
ingredient;
|
|
4
|
+
result;
|
|
5
|
+
constructor(definition, ingredient, result) {
|
|
6
|
+
super(definition);
|
|
7
|
+
this.ingredient = ingredient;
|
|
8
|
+
this.result = result;
|
|
9
|
+
}
|
|
3
10
|
getIngredients() {
|
|
4
|
-
return [this.
|
|
11
|
+
return [this.ingredient];
|
|
5
12
|
}
|
|
6
13
|
getResults() {
|
|
7
|
-
return [this.
|
|
14
|
+
return [this.result];
|
|
8
15
|
}
|
|
9
|
-
|
|
10
|
-
return new SmeltingRecipe(
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredient: replace(this.definition.ingredient),
|
|
13
|
-
});
|
|
16
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
17
|
+
return new SmeltingRecipe(this.definition, ingredientReplacer(this.ingredient), resultReplacer(this.result));
|
|
14
18
|
}
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
result:
|
|
19
|
-
}
|
|
19
|
+
serialize(context) {
|
|
20
|
+
return {
|
|
21
|
+
ingredient: context.ingredients.serialize(this.ingredient),
|
|
22
|
+
result: context.results.serialize(this.result),
|
|
23
|
+
};
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
export class SmeltingParser 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 SmeltingRecipe(definition, ingredient, result);
|
|
25
31
|
}
|
|
26
32
|
}
|
|
27
33
|
//# sourceMappingURL=smelting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smelting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smelting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smelting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smelting.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAGrB;IACA;IAHnB,YACE,UAA4B,EACX,UAAsB,EACtB,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAHD,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGjC,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,IAAI,CAAC,UAAU,EACf,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1D,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,YAGnC;IACC,WAAW,CACT,UAAoC,EACpC,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,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type SmithingRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
base:
|
|
8
|
-
addition:
|
|
9
|
-
result:
|
|
7
|
+
base: unknown;
|
|
8
|
+
addition: unknown;
|
|
9
|
+
result: unknown;
|
|
10
10
|
}>;
|
|
11
|
-
export declare class SmithingRecipe extends Recipe
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
export declare class SmithingRecipe extends Recipe {
|
|
12
|
+
private readonly base;
|
|
13
|
+
private readonly addition;
|
|
14
|
+
private readonly result;
|
|
15
|
+
constructor(definition: RecipeDefinition, base: Ingredient, addition: Ingredient, result: Result);
|
|
16
|
+
getIngredients(): Ingredient[];
|
|
17
|
+
getResults(): Result[];
|
|
18
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): SmithingRecipe;
|
|
19
|
+
serialize(context: RecipeParseContext): Partial<SmithingRecipeDefinition>;
|
|
16
20
|
}
|
|
17
|
-
export
|
|
18
|
-
|
|
21
|
+
export declare class SmithingParser extends RecipeParser<SmithingRecipeDefinition, SmithingRecipe> {
|
|
22
|
+
deserialize(definition: SmithingRecipeDefinition, context: RecipeParseContext): SmithingRecipe;
|
|
19
23
|
}
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class SmithingRecipe extends Recipe {
|
|
3
|
+
base;
|
|
4
|
+
addition;
|
|
5
|
+
result;
|
|
6
|
+
constructor(definition, base, addition, result) {
|
|
7
|
+
super(definition);
|
|
8
|
+
this.base = base;
|
|
9
|
+
this.addition = addition;
|
|
10
|
+
this.result = result;
|
|
11
|
+
}
|
|
3
12
|
getIngredients() {
|
|
4
|
-
return [this.
|
|
13
|
+
return [this.base, this.addition];
|
|
5
14
|
}
|
|
6
15
|
getResults() {
|
|
7
|
-
return [this.
|
|
16
|
+
return [this.result];
|
|
8
17
|
}
|
|
9
|
-
|
|
10
|
-
return new SmithingRecipe(
|
|
11
|
-
...this.definition,
|
|
12
|
-
base: replace(this.definition.base),
|
|
13
|
-
addition: replace(this.definition.addition),
|
|
14
|
-
});
|
|
18
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
19
|
+
return new SmithingRecipe(this.definition, ingredientReplacer(this.base), ingredientReplacer(this.addition), resultReplacer(this.result));
|
|
15
20
|
}
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
serialize(context) {
|
|
22
|
+
return {
|
|
23
|
+
base: context.ingredients.serialize(this.base),
|
|
24
|
+
addition: context.ingredients.serialize(this.addition),
|
|
25
|
+
result: context.results.serialize(this.result),
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
export class SmithingParser extends RecipeParser {
|
|
30
|
+
deserialize(definition, context) {
|
|
31
|
+
const base = context.ingredients.create(definition.base);
|
|
32
|
+
const addition = context.ingredients.create(definition.addition);
|
|
33
|
+
const result = context.results.create(definition.result);
|
|
34
|
+
return new SmithingRecipe(definition, base, addition, result);
|
|
26
35
|
}
|
|
27
36
|
}
|
|
28
37
|
//# sourceMappingURL=smithing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smithing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smithing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smithing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smithing.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAGrB;IACA;IACA;IAJnB,YACE,UAA4B,EACX,IAAgB,EAChB,QAAoB,EACpB,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAJD,SAAI,GAAJ,IAAI,CAAY;QAChB,aAAQ,GAAR,QAAQ,CAAY;QACpB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,cAAc,CACvB,IAAI,CAAC,UAAU,EACf,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAC7B,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EACjC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9C,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtD,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,YAGnC;IACC,WAAW,CACT,UAAoC,EACpC,OAA2B;QAE3B,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;CACF"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { Result, ResultInput } from "../../../common/result.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type { Replacer } from "../index.js";
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
6
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
7
6
|
export type StonecuttingRecipeDefinition = RecipeDefinition & Readonly<{
|
|
8
|
-
ingredient:
|
|
9
|
-
result:
|
|
7
|
+
ingredient: unknown;
|
|
8
|
+
result: unknown;
|
|
10
9
|
count?: number;
|
|
11
10
|
}>;
|
|
12
|
-
export declare class StonecuttingRecipe extends Recipe
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
export declare class StonecuttingRecipe extends Recipe {
|
|
12
|
+
private readonly ingredient;
|
|
13
|
+
private readonly result;
|
|
14
|
+
constructor(definition: RecipeDefinition, ingredient: Ingredient, result: Result);
|
|
15
|
+
getIngredients(): Ingredient[];
|
|
16
|
+
getResults(): Result[];
|
|
17
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): StonecuttingRecipe;
|
|
18
|
+
serialize(context: RecipeParseContext): Partial<StonecuttingRecipeDefinition>;
|
|
17
19
|
}
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
+
export declare class StonecuttingParser extends RecipeParser<StonecuttingRecipeDefinition, StonecuttingRecipe> {
|
|
21
|
+
deserialize(definition: StonecuttingRecipeDefinition, context: RecipeParseContext): StonecuttingRecipe;
|
|
20
22
|
}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import { encodeId } from "../../../common/id.js";
|
|
2
|
-
import { createResult } from "../../../common/result.js";
|
|
3
|
-
import { IllegalShapeError } from "../../../error.js";
|
|
4
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
// TODO could also be SmeltingRecipe?
|
|
5
3
|
export class StonecuttingRecipe extends Recipe {
|
|
4
|
+
ingredient;
|
|
5
|
+
result;
|
|
6
|
+
constructor(definition, ingredient, result) {
|
|
7
|
+
super(definition);
|
|
8
|
+
this.ingredient = ingredient;
|
|
9
|
+
this.result = result;
|
|
10
|
+
}
|
|
6
11
|
getIngredients() {
|
|
7
|
-
return [this.
|
|
12
|
+
return [this.ingredient];
|
|
8
13
|
}
|
|
9
14
|
getResults() {
|
|
10
|
-
return [
|
|
11
|
-
{ item: encodeId(this.definition.result), count: this.definition.count },
|
|
12
|
-
];
|
|
15
|
+
return [this.result];
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
return new StonecuttingRecipe(
|
|
16
|
-
...this.definition,
|
|
17
|
-
ingredient: replace(this.definition.ingredient),
|
|
18
|
-
});
|
|
17
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
18
|
+
return new StonecuttingRecipe(this.definition, ingredientReplacer(this.ingredient), resultReplacer(this.result));
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
...this.definition,
|
|
26
|
-
result: result.item,
|
|
27
|
-
count: result.count ?? 1,
|
|
28
|
-
});
|
|
20
|
+
serialize(context) {
|
|
21
|
+
return {
|
|
22
|
+
ingredient: context.ingredients.serialize(this.ingredient),
|
|
23
|
+
result: context.ingredients.serialize(this.result),
|
|
24
|
+
};
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
export class StonecuttingParser extends RecipeParser {
|
|
28
|
+
deserialize(definition, context) {
|
|
29
|
+
const ingredient = context.ingredients.create(definition.ingredient);
|
|
30
|
+
const result = context.results.create(definition.result);
|
|
31
|
+
return new StonecuttingRecipe(definition, ingredient, result);
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
34
|
//# sourceMappingURL=stonecutting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stonecutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/stonecutting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stonecutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/stonecutting.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,qCAAqC;AACrC,MAAM,OAAO,kBAAmB,SAAQ,MAAM;IAGzB;IACA;IAHnB,YACE,UAA4B,EACX,UAAsB,EACtB,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAHD,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGjC,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,kBAAkB,CAC3B,IAAI,CAAC,UAAU,EACf,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1D,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,YAGvC;IACC,WAAW,CACT,UAAwC,EACxC,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,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;CACF"}
|
package/dist/parser/roots.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export type { RootComponentRecipeDefinition } from "./recipe/roots/component.js";
|
|
4
|
-
export { RootComponentRecipe, default as RootComponentRecipeParser, } from "./recipe/roots/component.js";
|
|
1
|
+
export * from "./recipe/roots/component.js";
|
|
2
|
+
export * from "./recipe/roots/ritual.js";
|
package/dist/parser/roots.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from "./recipe/roots/component.js";
|
|
2
|
+
export * from "./recipe/roots/ritual.js";
|
|
3
3
|
//# sourceMappingURL=roots.js.map
|