@adeficior/data-modifier 1.0.0-rc.9
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/cli/codegen/registry.d.ts +3 -0
- package/dist/cli/codegen/registry.js +81 -0
- package/dist/cli/codegen/registry.js.map +1 -0
- package/dist/cli/config.d.ts +10 -0
- package/dist/cli/config.js +60 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +34 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/common/id.d.ts +15 -0
- package/dist/common/id.js +42 -0
- package/dist/common/id.js.map +1 -0
- package/dist/common/ingredient.d.ts +49 -0
- package/dist/common/ingredient.js +108 -0
- package/dist/common/ingredient.js.map +1 -0
- package/dist/common/predicates.d.ts +7 -0
- package/dist/common/predicates.js +32 -0
- package/dist/common/predicates.js.map +1 -0
- package/dist/common/registry.d.ts +12 -0
- package/dist/common/registry.js +36 -0
- package/dist/common/registry.js.map +1 -0
- package/dist/common/result.d.ts +48 -0
- package/dist/common/result.js +37 -0
- package/dist/common/result.js.map +1 -0
- package/dist/emit/assets/blockstates.d.ts +18 -0
- package/dist/emit/assets/blockstates.js +46 -0
- package/dist/emit/assets/blockstates.js.map +1 -0
- package/dist/emit/assets/lang.d.ts +33 -0
- package/dist/emit/assets/lang.js +103 -0
- package/dist/emit/assets/lang.js.map +1 -0
- package/dist/emit/assets/models.d.ts +24 -0
- package/dist/emit/assets/models.js +59 -0
- package/dist/emit/assets/models.js.map +1 -0
- package/dist/emit/blacklist.d.ts +32 -0
- package/dist/emit/blacklist.js +99 -0
- package/dist/emit/blacklist.js.map +1 -0
- package/dist/emit/content/blockDefinition.d.ts +58 -0
- package/dist/emit/content/blockDefinition.js +58 -0
- package/dist/emit/content/blockDefinition.js.map +1 -0
- package/dist/emit/content/innerBlockDefinition.d.ts +12 -0
- package/dist/emit/content/innerBlockDefinition.js +32 -0
- package/dist/emit/content/innerBlockDefinition.js.map +1 -0
- package/dist/emit/content/itemDefinition.d.ts +58 -0
- package/dist/emit/content/itemDefinition.js +54 -0
- package/dist/emit/content/itemDefinition.js.map +1 -0
- package/dist/emit/custom.d.ts +15 -0
- package/dist/emit/custom.js +42 -0
- package/dist/emit/custom.js.map +1 -0
- package/dist/emit/data/loot.d.ts +48 -0
- package/dist/emit/data/loot.js +108 -0
- package/dist/emit/data/loot.js.map +1 -0
- package/dist/emit/data/recipe.d.ts +46 -0
- package/dist/emit/data/recipe.js +106 -0
- package/dist/emit/data/recipe.js.map +1 -0
- package/dist/emit/data/tags.d.ts +38 -0
- package/dist/emit/data/tags.js +115 -0
- package/dist/emit/data/tags.js.map +1 -0
- package/dist/emit/index.d.ts +11 -0
- package/dist/emit/index.js +1 -0
- package/dist/emit/index.js.map +1 -0
- package/dist/emit/polytoneTabs.d.ts +65 -0
- package/dist/emit/polytoneTabs.js +101 -0
- package/dist/emit/polytoneTabs.js.map +1 -0
- package/dist/emit/rule/index.d.ts +10 -0
- package/dist/emit/rule/index.js +10 -0
- package/dist/emit/rule/index.js.map +1 -0
- package/dist/emit/rule/lootTable.d.ts +14 -0
- package/dist/emit/rule/lootTable.js +47 -0
- package/dist/emit/rule/lootTable.js.map +1 -0
- package/dist/emit/rule/recipe.d.ts +16 -0
- package/dist/emit/rule/recipe.js +29 -0
- package/dist/emit/rule/recipe.js.map +1 -0
- package/dist/emit/ruled.d.ts +18 -0
- package/dist/emit/ruled.js +47 -0
- package/dist/emit/ruled.js.map +1 -0
- package/dist/error.d.ts +12 -0
- package/dist/error.js +45 -0
- package/dist/error.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/loader/index.d.ts +16 -0
- package/dist/loader/index.js +40 -0
- package/dist/loader/index.js.map +1 -0
- package/dist/loader/lang.d.ts +7 -0
- package/dist/loader/lang.js +12 -0
- package/dist/loader/lang.js.map +1 -0
- package/dist/loader/loot.d.ts +7 -0
- package/dist/loader/loot.js +12 -0
- package/dist/loader/loot.js.map +1 -0
- package/dist/loader/pack.d.ts +62 -0
- package/dist/loader/pack.js +131 -0
- package/dist/loader/pack.js.map +1 -0
- package/dist/loader/recipe.d.ts +25 -0
- package/dist/loader/recipe.js +207 -0
- package/dist/loader/recipe.js.map +1 -0
- package/dist/loader/registry/dump.d.ts +19 -0
- package/dist/loader/registry/dump.js +74 -0
- package/dist/loader/registry/dump.js.map +1 -0
- package/dist/loader/registry/empty.d.ts +11 -0
- package/dist/loader/registry/empty.js +22 -0
- package/dist/loader/registry/empty.js.map +1 -0
- package/dist/loader/registry/index.d.ts +11 -0
- package/dist/loader/registry/index.js +1 -0
- package/dist/loader/registry/index.js.map +1 -0
- package/dist/loader/tags.d.ts +26 -0
- package/dist/loader/tags.js +131 -0
- package/dist/loader/tags.js.map +1 -0
- package/dist/parser/adAstra.d.ts +11 -0
- package/dist/parser/adAstra.js +6 -0
- package/dist/parser/adAstra.js.map +1 -0
- package/dist/parser/botania.d.ts +20 -0
- package/dist/parser/botania.js +11 -0
- package/dist/parser/botania.js.map +1 -0
- package/dist/parser/create.d.ts +4 -0
- package/dist/parser/create.js +3 -0
- package/dist/parser/create.js.map +1 -0
- package/dist/parser/farmersdelight.d.ts +4 -0
- package/dist/parser/farmersdelight.js +3 -0
- package/dist/parser/farmersdelight.js.map +1 -0
- package/dist/parser/index.d.ts +13 -0
- package/dist/parser/index.js +8 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/lootTable.d.ts +7 -0
- package/dist/parser/lootTable.js +70 -0
- package/dist/parser/lootTable.js.map +1 -0
- package/dist/parser/recipe/adAstra/conversion.d.ts +20 -0
- package/dist/parser/recipe/adAstra/conversion.js +33 -0
- package/dist/parser/recipe/adAstra/conversion.js.map +1 -0
- package/dist/parser/recipe/adAstra/hammering.d.ts +18 -0
- package/dist/parser/recipe/adAstra/hammering.js +27 -0
- package/dist/parser/recipe/adAstra/hammering.js.map +1 -0
- package/dist/parser/recipe/adAstra/index.d.ts +5 -0
- package/dist/parser/recipe/adAstra/index.js +1 -0
- package/dist/parser/recipe/adAstra/index.js.map +1 -0
- package/dist/parser/recipe/adAstra/inputOutput.d.ts +24 -0
- package/dist/parser/recipe/adAstra/inputOutput.js +42 -0
- package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -0
- package/dist/parser/recipe/adAstra/nasaWorkbench.d.ts +20 -0
- package/dist/parser/recipe/adAstra/nasaWorkbench.js +30 -0
- package/dist/parser/recipe/adAstra/nasaWorkbench.js.map +1 -0
- package/dist/parser/recipe/adAstra/spaceStation.d.ts +19 -0
- package/dist/parser/recipe/adAstra/spaceStation.js +27 -0
- package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -0
- package/dist/parser/recipe/botania/apothecary.d.ts +19 -0
- package/dist/parser/recipe/botania/apothecary.js +28 -0
- package/dist/parser/recipe/botania/apothecary.js.map +1 -0
- package/dist/parser/recipe/botania/brew.d.ts +18 -0
- package/dist/parser/recipe/botania/brew.js +24 -0
- package/dist/parser/recipe/botania/brew.js.map +1 -0
- package/dist/parser/recipe/botania/elvenTrade.d.ts +19 -0
- package/dist/parser/recipe/botania/elvenTrade.js +27 -0
- package/dist/parser/recipe/botania/elvenTrade.js.map +1 -0
- package/dist/parser/recipe/botania/gogWrapper.d.ts +22 -0
- package/dist/parser/recipe/botania/gogWrapper.js +34 -0
- package/dist/parser/recipe/botania/gogWrapper.js.map +1 -0
- package/dist/parser/recipe/botania/manaInfusion.d.ts +21 -0
- package/dist/parser/recipe/botania/manaInfusion.js +33 -0
- package/dist/parser/recipe/botania/manaInfusion.js.map +1 -0
- package/dist/parser/recipe/botania/nbtWrapper.d.ts +20 -0
- package/dist/parser/recipe/botania/nbtWrapper.js +30 -0
- package/dist/parser/recipe/botania/nbtWrapper.js.map +1 -0
- package/dist/parser/recipe/botania/orechid.d.ts +35 -0
- package/dist/parser/recipe/botania/orechid.js +74 -0
- package/dist/parser/recipe/botania/orechid.js.map +1 -0
- package/dist/parser/recipe/botania/pureDaisy.d.ts +19 -0
- package/dist/parser/recipe/botania/pureDaisy.js +30 -0
- package/dist/parser/recipe/botania/pureDaisy.js.map +1 -0
- package/dist/parser/recipe/botania/runicAltar.d.ts +19 -0
- package/dist/parser/recipe/botania/runicAltar.js +27 -0
- package/dist/parser/recipe/botania/runicAltar.js.map +1 -0
- package/dist/parser/recipe/botania/terraPlate.d.ts +19 -0
- package/dist/parser/recipe/botania/terraPlate.js +27 -0
- package/dist/parser/recipe/botania/terraPlate.js.map +1 -0
- package/dist/parser/recipe/create/assembly.d.ts +25 -0
- package/dist/parser/recipe/create/assembly.js +45 -0
- package/dist/parser/recipe/create/assembly.js.map +1 -0
- package/dist/parser/recipe/create/processing.d.ts +21 -0
- package/dist/parser/recipe/create/processing.js +27 -0
- package/dist/parser/recipe/create/processing.js.map +1 -0
- package/dist/parser/recipe/farmersdelight/cooking.d.ts +22 -0
- package/dist/parser/recipe/farmersdelight/cooking.js +29 -0
- package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -0
- package/dist/parser/recipe/farmersdelight/cutting.d.ts +23 -0
- package/dist/parser/recipe/farmersdelight/cutting.js +38 -0
- package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -0
- package/dist/parser/recipe/forge/conditional.d.ts +25 -0
- package/dist/parser/recipe/forge/conditional.js +45 -0
- package/dist/parser/recipe/forge/conditional.js.map +1 -0
- package/dist/parser/recipe/ignored.d.ts +10 -0
- package/dist/parser/recipe/ignored.js +16 -0
- package/dist/parser/recipe/ignored.js.map +1 -0
- package/dist/parser/recipe/index.d.ts +19 -0
- package/dist/parser/recipe/index.js +22 -0
- package/dist/parser/recipe/index.js.map +1 -0
- package/dist/parser/recipe/quark/exclusion.d.ts +20 -0
- package/dist/parser/recipe/quark/exclusion.js +32 -0
- package/dist/parser/recipe/quark/exclusion.js.map +1 -0
- package/dist/parser/recipe/roots/component.d.ts +18 -0
- package/dist/parser/recipe/roots/component.js +24 -0
- package/dist/parser/recipe/roots/component.js.map +1 -0
- package/dist/parser/recipe/roots/ritual.d.ts +22 -0
- package/dist/parser/recipe/roots/ritual.js +32 -0
- package/dist/parser/recipe/roots/ritual.js.map +1 -0
- package/dist/parser/recipe/sullys/polishing.d.ts +19 -0
- package/dist/parser/recipe/sullys/polishing.js +27 -0
- package/dist/parser/recipe/sullys/polishing.js.map +1 -0
- package/dist/parser/recipe/thermal/catalyst.d.ts +22 -0
- package/dist/parser/recipe/thermal/catalyst.js +24 -0
- package/dist/parser/recipe/thermal/catalyst.js.map +1 -0
- package/dist/parser/recipe/thermal/fuel.d.ts +18 -0
- package/dist/parser/recipe/thermal/fuel.js +24 -0
- package/dist/parser/recipe/thermal/fuel.js.map +1 -0
- package/dist/parser/recipe/thermal/index.d.ts +22 -0
- package/dist/parser/recipe/thermal/index.js +36 -0
- package/dist/parser/recipe/thermal/index.js.map +1 -0
- package/dist/parser/recipe/thermal/ingredient.d.ts +21 -0
- package/dist/parser/recipe/thermal/ingredient.js +43 -0
- package/dist/parser/recipe/thermal/ingredient.js.map +1 -0
- package/dist/parser/recipe/thermal/treeExtraction.d.ts +24 -0
- package/dist/parser/recipe/thermal/treeExtraction.js +47 -0
- package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -0
- package/dist/parser/recipe/vanilla/shaped.d.ts +19 -0
- package/dist/parser/recipe/vanilla/shaped.js +28 -0
- package/dist/parser/recipe/vanilla/shaped.js.map +1 -0
- package/dist/parser/recipe/vanilla/shapeless.d.ts +18 -0
- package/dist/parser/recipe/vanilla/shapeless.js +27 -0
- package/dist/parser/recipe/vanilla/shapeless.js.map +1 -0
- package/dist/parser/recipe/vanilla/smelting.d.ts +19 -0
- package/dist/parser/recipe/vanilla/smelting.js +27 -0
- package/dist/parser/recipe/vanilla/smelting.js.map +1 -0
- package/dist/parser/recipe/vanilla/smithing.d.ts +19 -0
- package/dist/parser/recipe/vanilla/smithing.js +28 -0
- package/dist/parser/recipe/vanilla/smithing.js.map +1 -0
- package/dist/parser/recipe/vanilla/stonecutting.d.ts +20 -0
- package/dist/parser/recipe/vanilla/stonecutting.js +36 -0
- package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -0
- package/dist/parser/roots.d.ts +4 -0
- package/dist/parser/roots.js +3 -0
- package/dist/parser/roots.js.map +1 -0
- package/dist/parser/thermal.d.ts +10 -0
- package/dist/parser/thermal.js +6 -0
- package/dist/parser/thermal.js.map +1 -0
- package/dist/schema/assets/blockstate.d.ts +10 -0
- package/dist/schema/assets/blockstate.js +1 -0
- package/dist/schema/assets/blockstate.js.map +1 -0
- package/dist/schema/assets/lang.d.ts +3 -0
- package/dist/schema/assets/lang.js +3 -0
- package/dist/schema/assets/lang.js.map +1 -0
- package/dist/schema/assets/model.d.ts +27 -0
- package/dist/schema/assets/model.js +1 -0
- package/dist/schema/assets/model.js.map +1 -0
- package/dist/schema/content/blockDefinition.d.ts +11 -0
- package/dist/schema/content/blockDefinition.js +1 -0
- package/dist/schema/content/blockDefinition.js.map +1 -0
- package/dist/schema/content/itemDefinition.d.ts +14 -0
- package/dist/schema/content/itemDefinition.js +1 -0
- package/dist/schema/content/itemDefinition.js.map +1 -0
- package/dist/schema/data/loot.d.ts +1151 -0
- package/dist/schema/data/loot.js +76 -0
- package/dist/schema/data/loot.js.map +1 -0
- package/dist/schema/data/recipe.d.ts +13 -0
- package/dist/schema/data/recipe.js +1 -0
- package/dist/schema/data/recipe.js.map +1 -0
- package/dist/schema/data/tag.d.ts +11 -0
- package/dist/schema/data/tag.js +6 -0
- package/dist/schema/data/tag.js.map +1 -0
- package/dist/stubTypes.d.ts +7 -0
- package/dist/stubTypes.js +1 -0
- package/dist/stubTypes.js.map +1 -0
- package/dist/textHelper.d.ts +3 -0
- package/dist/textHelper.js +20 -0
- package/dist/textHelper.js.map +1 -0
- package/package.json +96 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
import { createIngredient } from "../../../common/ingredient.js";
|
|
3
|
+
import { encodeId } from "../../../common/id.js";
|
|
4
|
+
import { createResult } from "../../../common/result.js";
|
|
5
|
+
import { IllegalShapeError } from "../../../error.js";
|
|
6
|
+
export function createBlockInput(input) {
|
|
7
|
+
const ingredient = createIngredient(input);
|
|
8
|
+
if ("block" in ingredient)
|
|
9
|
+
return {
|
|
10
|
+
type: "block",
|
|
11
|
+
block: ingredient.block,
|
|
12
|
+
};
|
|
13
|
+
if ("blockTag" in ingredient)
|
|
14
|
+
return {
|
|
15
|
+
type: "tag",
|
|
16
|
+
tag: ingredient.blockTag,
|
|
17
|
+
};
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
export function createBlockOutput(input) {
|
|
21
|
+
const result = createResult(input);
|
|
22
|
+
if ("block" in result)
|
|
23
|
+
return {
|
|
24
|
+
name: result.block,
|
|
25
|
+
};
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
export function fromBlockInput(input) {
|
|
29
|
+
switch (input.type) {
|
|
30
|
+
case "block":
|
|
31
|
+
return {
|
|
32
|
+
block: encodeId(input.block),
|
|
33
|
+
};
|
|
34
|
+
case "tag":
|
|
35
|
+
return {
|
|
36
|
+
blockTag: encodeId(input.tag),
|
|
37
|
+
};
|
|
38
|
+
default:
|
|
39
|
+
throw new IllegalShapeError(`Unknown block input type`, input);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function fromBlockOutput(output) {
|
|
43
|
+
const name = typeof output === "string" ? output : output.name;
|
|
44
|
+
return {
|
|
45
|
+
block: encodeId(name),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export class OrechidRecipe extends Recipe {
|
|
49
|
+
getIngredients() {
|
|
50
|
+
return [fromBlockInput(this.definition.input)];
|
|
51
|
+
}
|
|
52
|
+
getResults() {
|
|
53
|
+
return [fromBlockInput(this.definition.output)];
|
|
54
|
+
}
|
|
55
|
+
replaceIngredient(replace) {
|
|
56
|
+
return new OrechidRecipe({
|
|
57
|
+
...this.definition,
|
|
58
|
+
input: createBlockInput(replace(fromBlockInput(this.definition.input))) ??
|
|
59
|
+
this.definition.input,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
replaceResult(replace) {
|
|
63
|
+
return new OrechidRecipe({
|
|
64
|
+
...this.definition,
|
|
65
|
+
output: createBlockInput(replace(fromBlockInput(this.definition.output))) ?? this.definition.output,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export default class OrechidRecipeParser extends RecipeParser {
|
|
70
|
+
create(definition) {
|
|
71
|
+
return new OrechidRecipe(definition);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=orechid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orechid.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/orechid.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA2BtD,MAAM,UAAU,gBAAgB,CAAC,KAAsB;IACrD,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE3C,IAAI,OAAO,IAAI,UAAU;QACvB,OAAO;YACL,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,UAAU,CAAC,KAAK;SACxB,CAAC;IAEJ,IAAI,UAAU,IAAI,UAAU;QAC1B,OAAO;YACL,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,UAAU,CAAC,QAAQ;SACzB,CAAC;IAEJ,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAkB;IAClD,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,OAAO,IAAI,MAAM;QACnB,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,KAAK;SACnB,CAAC;IAEJ,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAiB;IAC9C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,OAAO;YACV,OAAO;gBACL,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;aAC7B,CAAC;QACJ,KAAK,KAAK;YACR,OAAO;gBACL,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;aAC9B,CAAC;QACJ;YACE,MAAM,IAAI,iBAAiB,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAmB;IACjD,MAAM,IAAI,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAC/D,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC;KACtB,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,aAAc,SAAQ,MAA+B;IAChE,cAAc;QACZ,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,UAAU;QACR,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAU,CAAC,CAAC;IAC3D,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,aAAa,CAAC;YACvB,GAAG,IAAI,CAAC,UAAU;YAClB,KAAK,EACH,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gBAChE,IAAI,CAAC,UAAU,CAAC,KAAK;SACxB,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,aAAa,CAAC;YACvB,GAAG,IAAI,CAAC,UAAU;YAClB,MAAM,EACJ,gBAAgB,CACd,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAU,CAAC,CACzD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM;SAC9B,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,YAGhD;IACC,MAAM,CAAC,UAAmC;QACxC,OAAO,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Replacer } from "../index.js";
|
|
2
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
+
import type { BlockInput, BlockOutput } from "./orechid.js";
|
|
6
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
7
|
+
export type PureDaisyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
8
|
+
input: BlockInput;
|
|
9
|
+
output: BlockOutput;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class PureDaisyRecipe extends Recipe<PureDaisyRecipeDefinition> {
|
|
12
|
+
getIngredients(): IngredientInput[];
|
|
13
|
+
getResults(): ResultInput[];
|
|
14
|
+
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
15
|
+
replaceResult(replace: Replacer<Result>): Recipe;
|
|
16
|
+
}
|
|
17
|
+
export default class PureDaisyRecipeParser extends RecipeParser<PureDaisyRecipeDefinition, PureDaisyRecipe> {
|
|
18
|
+
create(definition: PureDaisyRecipeDefinition): PureDaisyRecipe;
|
|
19
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
import { createBlockInput, createBlockOutput, fromBlockInput, fromBlockOutput, } from "./orechid.js";
|
|
3
|
+
export class PureDaisyRecipe extends Recipe {
|
|
4
|
+
getIngredients() {
|
|
5
|
+
return [fromBlockInput(this.definition.input)];
|
|
6
|
+
}
|
|
7
|
+
getResults() {
|
|
8
|
+
return [fromBlockOutput(this.definition.output)];
|
|
9
|
+
}
|
|
10
|
+
replaceIngredient(replace) {
|
|
11
|
+
return new PureDaisyRecipe({
|
|
12
|
+
...this.definition,
|
|
13
|
+
input: createBlockInput(replace(fromBlockInput(this.definition.input))) ??
|
|
14
|
+
this.definition.input,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
replaceResult(replace) {
|
|
18
|
+
return new PureDaisyRecipe({
|
|
19
|
+
...this.definition,
|
|
20
|
+
output: createBlockOutput(replace(fromBlockOutput(this.definition.output))) ??
|
|
21
|
+
this.definition.output,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export default class PureDaisyRecipeParser extends RecipeParser {
|
|
26
|
+
create(definition) {
|
|
27
|
+
return new PureDaisyRecipe(definition);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=pureDaisy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pureDaisy.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/pureDaisy.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOnD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,cAAc,CAAC;AAStB,MAAM,OAAO,eAAgB,SAAQ,MAAiC;IACpE,cAAc;QACZ,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,UAAU;QACR,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,eAAe,CAAC;YACzB,GAAG,IAAI,CAAC,UAAU;YAClB,KAAK,EACH,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gBAChE,IAAI,CAAC,UAAU,CAAC,KAAK;SACxB,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,eAAe,CAAC;YACzB,GAAG,IAAI,CAAC,UAAU;YAClB,MAAM,EACJ,iBAAiB,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;gBACnE,IAAI,CAAC,UAAU,CAAC,MAAM;SACzB,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAGlD;IACC,MAAM,CAAC,UAAqC;QAC1C,OAAO,IAAI,eAAe,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Replacer } from "../index.js";
|
|
2
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
6
|
+
export type RunicAltarRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
+
ingredients: Ingredient[];
|
|
8
|
+
output: Result;
|
|
9
|
+
mana: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class RunicAltarRecipe extends Recipe<RunicAltarRecipeDefinition> {
|
|
12
|
+
getIngredients(): IngredientInput[];
|
|
13
|
+
getResults(): ResultInput[];
|
|
14
|
+
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
15
|
+
replaceResult(replace: Replacer<Result>): Recipe;
|
|
16
|
+
}
|
|
17
|
+
export default class RunicAltarRecipeParser extends RecipeParser<RunicAltarRecipeDefinition, RunicAltarRecipe> {
|
|
18
|
+
create(definition: RunicAltarRecipeDefinition): RunicAltarRecipe;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
export class RunicAltarRecipe extends Recipe {
|
|
3
|
+
getIngredients() {
|
|
4
|
+
return this.definition.ingredients;
|
|
5
|
+
}
|
|
6
|
+
getResults() {
|
|
7
|
+
return [this.definition.output];
|
|
8
|
+
}
|
|
9
|
+
replaceIngredient(replace) {
|
|
10
|
+
return new RunicAltarRecipe({
|
|
11
|
+
...this.definition,
|
|
12
|
+
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
replaceResult(replace) {
|
|
16
|
+
return new RunicAltarRecipe({
|
|
17
|
+
...this.definition,
|
|
18
|
+
output: replace(this.definition.output),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export default class RunicAltarRecipeParser extends RecipeParser {
|
|
23
|
+
create(definition) {
|
|
24
|
+
return new RunicAltarRecipe(definition);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=runicAltar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runicAltar.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/runicAltar.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAenD,MAAM,OAAO,gBAAiB,SAAQ,MAAkC;IACtE,cAAc;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACrC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,gBAAgB,CAAC;YAC1B,GAAG,IAAI,CAAC,UAAU;YAClB,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,gBAAgB,CAAC;YAC1B,GAAG,IAAI,CAAC,UAAU;YAClB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,YAGnD;IACC,MAAM,CAAC,UAAsC;QAC3C,OAAO,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Replacer } from "../index.js";
|
|
2
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
6
|
+
export type TerraPlateRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
+
ingredients: Ingredient[];
|
|
8
|
+
result: Result;
|
|
9
|
+
mana?: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class TerraPlateRecipe extends Recipe<TerraPlateRecipeDefinition> {
|
|
12
|
+
getIngredients(): IngredientInput[];
|
|
13
|
+
getResults(): ResultInput[];
|
|
14
|
+
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
15
|
+
replaceResult(replace: Replacer<Result>): Recipe;
|
|
16
|
+
}
|
|
17
|
+
export default class TerraPlateRecipeParser extends RecipeParser<TerraPlateRecipeDefinition, TerraPlateRecipe> {
|
|
18
|
+
create(definition: TerraPlateRecipeDefinition): TerraPlateRecipe;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
export class TerraPlateRecipe extends Recipe {
|
|
3
|
+
getIngredients() {
|
|
4
|
+
return this.definition.ingredients;
|
|
5
|
+
}
|
|
6
|
+
getResults() {
|
|
7
|
+
return [this.definition.result];
|
|
8
|
+
}
|
|
9
|
+
replaceIngredient(replace) {
|
|
10
|
+
return new TerraPlateRecipe({
|
|
11
|
+
...this.definition,
|
|
12
|
+
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
replaceResult(replace) {
|
|
16
|
+
return new TerraPlateRecipe({
|
|
17
|
+
...this.definition,
|
|
18
|
+
result: replace(this.definition.result),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export default class TerraPlateRecipeParser extends RecipeParser {
|
|
23
|
+
create(definition) {
|
|
24
|
+
return new TerraPlateRecipe(definition);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=terraPlate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraPlate.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/terraPlate.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAenD,MAAM,OAAO,gBAAiB,SAAQ,MAAkC;IACtE,cAAc;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACrC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,gBAAgB,CAAC;YAC1B,GAAG,IAAI,CAAC,UAAU;YAClB,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,gBAAgB,CAAC;YAC1B,GAAG,IAAI,CAAC,UAAU;YAClB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,YAGnD;IACC,MAAM,CAAC,UAAsC;QAC3C,OAAO,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
2
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
3
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
+
import type { Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
|
+
import type { CreateProcessingRecipeDefinition } from "./processing.js";
|
|
7
|
+
export type AssemblyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
8
|
+
ingredient: Ingredient;
|
|
9
|
+
transitionalItem: Ingredient;
|
|
10
|
+
results: Result[];
|
|
11
|
+
loops?: number;
|
|
12
|
+
sequence: CreateProcessingRecipeDefinition[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare class AssemblyRecipe extends Recipe<AssemblyRecipeDefinition> {
|
|
15
|
+
protected readonly definition: AssemblyRecipeDefinition;
|
|
16
|
+
private readonly sequence;
|
|
17
|
+
constructor(definition: AssemblyRecipeDefinition);
|
|
18
|
+
getIngredients(): IngredientInput[];
|
|
19
|
+
getResults(): ResultInput[];
|
|
20
|
+
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
21
|
+
replaceResult(replace: Replacer<Result>): Recipe;
|
|
22
|
+
}
|
|
23
|
+
export default class AssemblyRecipeParser extends RecipeParser<AssemblyRecipeDefinition, AssemblyRecipe> {
|
|
24
|
+
create(definition: AssemblyRecipeDefinition): AssemblyRecipe;
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
import { CreateProcessingRecipe } from "./processing.js";
|
|
3
|
+
export class AssemblyRecipe extends Recipe {
|
|
4
|
+
definition;
|
|
5
|
+
sequence;
|
|
6
|
+
constructor(definition) {
|
|
7
|
+
super(definition);
|
|
8
|
+
this.definition = definition;
|
|
9
|
+
this.sequence = this.definition.sequence.map((it) => new CreateProcessingRecipe(it));
|
|
10
|
+
}
|
|
11
|
+
getIngredients() {
|
|
12
|
+
return [
|
|
13
|
+
this.definition.ingredient,
|
|
14
|
+
this.definition.transitionalItem,
|
|
15
|
+
...this.sequence.flatMap((it) => it.getIngredients()),
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
getResults() {
|
|
19
|
+
return [
|
|
20
|
+
...this.definition.results,
|
|
21
|
+
...this.sequence.flatMap((it) => it.getResults()),
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
replaceIngredient(replace) {
|
|
25
|
+
return new AssemblyRecipe({
|
|
26
|
+
...this.definition,
|
|
27
|
+
ingredient: replace(this.definition.ingredient),
|
|
28
|
+
transitionalItem: replace(this.definition.ingredient),
|
|
29
|
+
sequence: this.sequence.map((it) => it.replaceIngredient(replace).toJSON()),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
replaceResult(replace) {
|
|
33
|
+
return new AssemblyRecipe({
|
|
34
|
+
...this.definition,
|
|
35
|
+
results: this.definition.results.map(replace),
|
|
36
|
+
sequence: this.sequence.map((it) => it.replaceResult(replace).toJSON()),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export default class AssemblyRecipeParser extends RecipeParser {
|
|
41
|
+
create(definition) {
|
|
42
|
+
return new AssemblyRecipe(definition);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=assembly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/assembly.ts"],"names":[],"mappings":"AAOA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAWzD,MAAM,OAAO,cAAe,SAAQ,MAAgC;IAIpC;IAHb,QAAQ,CAA2B;IAEpD,YAC8B,UAAoC;QAEhE,KAAK,CAAC,UAAU,CAAC,CAAC;QAFU,eAAU,GAAV,UAAU,CAA0B;QAGhE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAC1C,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,sBAAsB,CAAC,EAAE,CAAC,CACvC,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO;YACL,IAAI,CAAC,UAAU,CAAC,UAAU;YAC1B,IAAI,CAAC,UAAU,CAAC,gBAAgB;YAChC,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC;SACtD,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO;YACL,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO;YAC1B,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;SAClD,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,cAAc,CAAC;YACxB,GAAG,IAAI,CAAC,UAAU;YAClB,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YAC/C,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;YACrD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CACjC,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CACvC;SACF,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,cAAc,CAAC;YACxB,GAAG,IAAI,CAAC,UAAU;YAClB,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;YAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;SACxE,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAGjD;IACC,MAAM,CAAC,UAAoC;QACzC,OAAO,IAAI,cAAc,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Replacer } from "../index.js";
|
|
2
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
6
|
+
export type CreateProcessingRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
+
ingredients: Ingredient[];
|
|
8
|
+
results: Result[];
|
|
9
|
+
heatRequirement?: string;
|
|
10
|
+
processingTime?: number;
|
|
11
|
+
keepHeldItem?: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare class CreateProcessingRecipe extends Recipe<CreateProcessingRecipeDefinition> {
|
|
14
|
+
getIngredients(): IngredientInput[];
|
|
15
|
+
getResults(): ResultInput[];
|
|
16
|
+
replaceIngredient(replace: Replacer<Ingredient>): CreateProcessingRecipe;
|
|
17
|
+
replaceResult(replace: Replacer<Result>): CreateProcessingRecipe;
|
|
18
|
+
}
|
|
19
|
+
export default class CreateProcessingRecipeParser extends RecipeParser<CreateProcessingRecipeDefinition, CreateProcessingRecipe> {
|
|
20
|
+
create(definition: CreateProcessingRecipeDefinition): CreateProcessingRecipe;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
export class CreateProcessingRecipe extends Recipe {
|
|
3
|
+
getIngredients() {
|
|
4
|
+
return this.definition.ingredients;
|
|
5
|
+
}
|
|
6
|
+
getResults() {
|
|
7
|
+
return this.definition.results;
|
|
8
|
+
}
|
|
9
|
+
replaceIngredient(replace) {
|
|
10
|
+
return new CreateProcessingRecipe({
|
|
11
|
+
...this.definition,
|
|
12
|
+
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
replaceResult(replace) {
|
|
16
|
+
return new CreateProcessingRecipe({
|
|
17
|
+
...this.definition,
|
|
18
|
+
results: this.definition.results.map(replace),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export default class CreateProcessingRecipeParser extends RecipeParser {
|
|
23
|
+
create(definition) {
|
|
24
|
+
return new CreateProcessingRecipe(definition);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=processing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/processing.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAiBnD,MAAM,OAAO,sBAAuB,SAAQ,MAAwC;IAClF,cAAc;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACrC,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IACjC,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,sBAAsB,CAAC;YAChC,GAAG,IAAI,CAAC,UAAU;YAClB,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,sBAAsB,CAAC;YAChC,GAAG,IAAI,CAAC,UAAU;YAClB,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,YAGzD;IACC,MAAM,CAAC,UAA4C;QACjD,OAAO,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
2
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
3
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
+
import type { Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
|
+
export type CookingRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
+
ingredients: Ingredient[];
|
|
8
|
+
container?: Ingredient;
|
|
9
|
+
result: Result;
|
|
10
|
+
cookingTime?: number;
|
|
11
|
+
experience?: number;
|
|
12
|
+
recipe_book_tab?: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare class CookingRecipe extends Recipe<CookingRecipeDefinition> {
|
|
15
|
+
getIngredients(): IngredientInput[];
|
|
16
|
+
getResults(): ResultInput[];
|
|
17
|
+
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
18
|
+
replaceResult(replace: Replacer<Result>): Recipe;
|
|
19
|
+
}
|
|
20
|
+
export default class CookingRecipeParser extends RecipeParser<CookingRecipeDefinition, CookingRecipe> {
|
|
21
|
+
create(definition: CookingRecipeDefinition): CookingRecipe;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { exists } from "@adeficior/pack-resolver";
|
|
2
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
+
export class CookingRecipe extends Recipe {
|
|
4
|
+
getIngredients() {
|
|
5
|
+
return [this.definition.container, ...this.definition.ingredients].filter(exists);
|
|
6
|
+
}
|
|
7
|
+
getResults() {
|
|
8
|
+
return [this.definition.result];
|
|
9
|
+
}
|
|
10
|
+
replaceIngredient(replace) {
|
|
11
|
+
return new CookingRecipe({
|
|
12
|
+
...this.definition,
|
|
13
|
+
container: this.definition.container && replace(this.definition.container),
|
|
14
|
+
ingredients: this.definition.ingredients.map(replace),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
replaceResult(replace) {
|
|
18
|
+
return new CookingRecipe({
|
|
19
|
+
...this.definition,
|
|
20
|
+
result: replace(this.definition.result),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export default class CookingRecipeParser extends RecipeParser {
|
|
25
|
+
create(definition) {
|
|
26
|
+
return new CookingRecipe(definition);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=cooking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cooking.js","sourceRoot":"","sources":["../../../../src/parser/recipe/farmersdelight/cooking.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAQlD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,aAAc,SAAQ,MAA+B;IAChE,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CACvE,MAAM,CACP,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,aAAa,CAAC;YACvB,GAAG,IAAI,CAAC,UAAU;YAClB,SAAS,EACP,IAAI,CAAC,UAAU,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;YACjE,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,aAAa,CAAC;YACvB,GAAG,IAAI,CAAC,UAAU;YAClB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,YAGhD;IACC,MAAM,CAAC,UAAmC;QACxC,OAAO,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Replacer } from "../index.js";
|
|
2
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
6
|
+
export type ToolInput = Readonly<{
|
|
7
|
+
type: "farmersdelight:tool_action";
|
|
8
|
+
action: string;
|
|
9
|
+
}>;
|
|
10
|
+
export type CuttingRecipeDefinition = RecipeDefinition & Readonly<{
|
|
11
|
+
ingredients: Ingredient[];
|
|
12
|
+
result: Result[];
|
|
13
|
+
tool: Ingredient | ToolInput;
|
|
14
|
+
}>;
|
|
15
|
+
export declare class CuttingRecipe extends Recipe<CuttingRecipeDefinition> {
|
|
16
|
+
getIngredients(): IngredientInput[];
|
|
17
|
+
getResults(): ResultInput[];
|
|
18
|
+
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
19
|
+
replaceResult(replace: Replacer<Result>): Recipe;
|
|
20
|
+
}
|
|
21
|
+
export default class CuttingRecipeParser extends RecipeParser<CuttingRecipeDefinition, CuttingRecipe> {
|
|
22
|
+
create(definition: CuttingRecipeDefinition): CuttingRecipe;
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
function isToolInput(input) {
|
|
3
|
+
return (!!input &&
|
|
4
|
+
typeof input === "object" &&
|
|
5
|
+
"type" in input &&
|
|
6
|
+
input.type === "farmersdelight:tool_action");
|
|
7
|
+
}
|
|
8
|
+
export class CuttingRecipe extends Recipe {
|
|
9
|
+
getIngredients() {
|
|
10
|
+
if (isToolInput(this.definition.tool))
|
|
11
|
+
return this.definition.ingredients;
|
|
12
|
+
return [...this.definition.ingredients, this.definition.tool];
|
|
13
|
+
}
|
|
14
|
+
getResults() {
|
|
15
|
+
return this.definition.result;
|
|
16
|
+
}
|
|
17
|
+
replaceIngredient(replace) {
|
|
18
|
+
return new CuttingRecipe({
|
|
19
|
+
...this.definition,
|
|
20
|
+
ingredients: this.definition.ingredients.map(replace),
|
|
21
|
+
tool: isToolInput(this.definition.tool)
|
|
22
|
+
? this.definition.tool
|
|
23
|
+
: replace(this.definition.tool),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
replaceResult(replace) {
|
|
27
|
+
return new CuttingRecipe({
|
|
28
|
+
...this.definition,
|
|
29
|
+
result: this.definition.result.map(replace),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export default class CuttingRecipeParser extends RecipeParser {
|
|
34
|
+
create(definition) {
|
|
35
|
+
return new CuttingRecipe(definition);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cutting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/farmersdelight/cutting.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAoBnD,SAAS,WAAW,CAAI,KAAoB;IAC1C,OAAO,CACL,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;QACzB,MAAM,IAAI,KAAK;QACf,KAAK,CAAC,IAAI,KAAK,4BAA4B,CAC5C,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,aAAc,SAAQ,MAA+B;IAChE,cAAc;QACZ,IAAI,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;QAC1E,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAChC,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,aAAa,CAAC;YACvB,GAAG,IAAI,CAAC,UAAU;YAClB,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC;YACrD,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBACrC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI;gBACtB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;SAClC,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,aAAa,CAAC;YACvB,GAAG,IAAI,CAAC,UAAU;YAClB,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,YAGhD;IACC,MAAM,CAAC,UAAmC;QACxC,OAAO,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
2
|
+
import type { Result, ResultInput } from "../../../common/result.js";
|
|
3
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
+
import type { InlineRecipeParser, Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
|
+
type WithConditions<T> = {
|
|
7
|
+
conditions: unknown[];
|
|
8
|
+
recipe: T;
|
|
9
|
+
};
|
|
10
|
+
export type ForgeConditionalRecipeDefinition = RecipeDefinition & Readonly<{
|
|
11
|
+
recipes: WithConditions<RecipeDefinition>[];
|
|
12
|
+
}>;
|
|
13
|
+
export declare class ForgeConditionalRecipe extends Recipe<ForgeConditionalRecipeDefinition> {
|
|
14
|
+
private readonly recipes;
|
|
15
|
+
constructor(definition: Omit<ForgeConditionalRecipeDefinition, "recipes">, recipes: WithConditions<Recipe>[]);
|
|
16
|
+
getIngredients(): IngredientInput[];
|
|
17
|
+
getResults(): ResultInput[];
|
|
18
|
+
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
19
|
+
replaceResult(replace: Replacer<Result>): Recipe;
|
|
20
|
+
getTypes(): string[];
|
|
21
|
+
}
|
|
22
|
+
export default class ForgeConditionalRecipeParser extends RecipeParser<ForgeConditionalRecipeDefinition, ForgeConditionalRecipe> {
|
|
23
|
+
create(definition: ForgeConditionalRecipeDefinition, parser: InlineRecipeParser): ForgeConditionalRecipe;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
+
export class ForgeConditionalRecipe extends Recipe {
|
|
3
|
+
recipes;
|
|
4
|
+
constructor(definition, recipes) {
|
|
5
|
+
super({
|
|
6
|
+
...definition,
|
|
7
|
+
recipes: recipes.map((it) => ({
|
|
8
|
+
conditions: it.conditions,
|
|
9
|
+
recipe: it.recipe.toJSON(),
|
|
10
|
+
})),
|
|
11
|
+
});
|
|
12
|
+
this.recipes = recipes;
|
|
13
|
+
}
|
|
14
|
+
getIngredients() {
|
|
15
|
+
return this.recipes.flatMap((it) => it.recipe.getIngredients());
|
|
16
|
+
}
|
|
17
|
+
getResults() {
|
|
18
|
+
return this.recipes.flatMap((it) => it.recipe.getResults());
|
|
19
|
+
}
|
|
20
|
+
replaceIngredient(replace) {
|
|
21
|
+
return new ForgeConditionalRecipe(this.definition, this.recipes.map((it) => ({
|
|
22
|
+
...it,
|
|
23
|
+
recipe: it.recipe.replaceIngredient(replace),
|
|
24
|
+
})));
|
|
25
|
+
}
|
|
26
|
+
replaceResult(replace) {
|
|
27
|
+
return new ForgeConditionalRecipe(this.definition, this.recipes.map((it) => ({
|
|
28
|
+
...it,
|
|
29
|
+
recipe: it.recipe.replaceResult(replace),
|
|
30
|
+
})));
|
|
31
|
+
}
|
|
32
|
+
getTypes() {
|
|
33
|
+
return this.definition.recipes.map((it) => it.recipe.type);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export default class ForgeConditionalRecipeParser extends RecipeParser {
|
|
37
|
+
create(definition, parser) {
|
|
38
|
+
const recipes = definition.recipes.map((it) => ({
|
|
39
|
+
conditions: it.conditions,
|
|
40
|
+
recipe: parser(it.recipe),
|
|
41
|
+
}));
|
|
42
|
+
return new ForgeConditionalRecipe(definition, recipes);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=conditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../../src/parser/recipe/forge/conditional.ts"],"names":[],"mappings":"AAOA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,sBAAuB,SAAQ,MAAwC;IAG/D;IAFnB,YACE,UAA6D,EAC5C,OAAiC;QAElD,KAAK,CAAC;YACJ,GAAG,UAAU;YACb,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC5B,UAAU,EAAE,EAAE,CAAC,UAAU;gBACzB,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE;aAC3B,CAAC,CAAC;SACJ,CAAC,CAAC;QARc,YAAO,GAAP,OAAO,CAA0B;IASpD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,IAAI,sBAAsB,CAC/B,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACxB,GAAG,EAAE;YACL,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC;SAC7C,CAAC,CAAC,CACJ,CAAC;IACJ,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,sBAAsB,CAC/B,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACxB,GAAG,EAAE;YACL,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC;SACzC,CAAC,CAAC,CACJ,CAAC;IACJ,CAAC;IAEQ,QAAQ;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,YAGzD;IACC,MAAM,CACJ,UAA4C,EAC5C,MAA0B;QAE1B,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAyB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACtE,UAAU,EAAE,EAAE,CAAC,UAAU;YACzB,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC;SAC1B,CAAC,CAAC,CAAC;QAEJ,OAAO,IAAI,sBAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Recipe } from "./index.js";
|
|
2
|
+
import type { IngredientInput } from "../../common/ingredient.js";
|
|
3
|
+
import type { ResultInput } from "../../common/result.js";
|
|
4
|
+
import type { RecipeDefinition } from "../../schema/data/recipe.js";
|
|
5
|
+
export default class IgnoredRecipe<T extends RecipeDefinition> extends Recipe<T> {
|
|
6
|
+
getIngredients(): IngredientInput[];
|
|
7
|
+
getResults(): ResultInput[];
|
|
8
|
+
replaceIngredient(): Recipe;
|
|
9
|
+
replaceResult(): Recipe;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Recipe } from "./index.js";
|
|
2
|
+
export default class IgnoredRecipe extends Recipe {
|
|
3
|
+
getIngredients() {
|
|
4
|
+
return [];
|
|
5
|
+
}
|
|
6
|
+
getResults() {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
replaceIngredient() {
|
|
10
|
+
return new IgnoredRecipe(this.definition);
|
|
11
|
+
}
|
|
12
|
+
replaceResult() {
|
|
13
|
+
return new IgnoredRecipe(this.definition);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=ignored.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignored.js","sourceRoot":"","sources":["../../../src/parser/recipe/ignored.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAKpC,MAAM,CAAC,OAAO,OAAO,aAEnB,SAAQ,MAAS;IACjB,cAAc;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED,aAAa;QACX,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Ingredient, IngredientInput, Predicate } from "../../common/ingredient.js";
|
|
2
|
+
import type { Result, ResultInput } from "../../common/result.js";
|
|
3
|
+
import type { RecipeDefinition } from "../../schema/data/recipe.js";
|
|
4
|
+
export type Replacer<T> = (value: T) => T;
|
|
5
|
+
export declare function createReplacer<T>(from: Predicate<T>, to: T): Replacer<T>;
|
|
6
|
+
export declare abstract class Recipe<TDefinition extends RecipeDefinition = RecipeDefinition> {
|
|
7
|
+
protected readonly definition: TDefinition;
|
|
8
|
+
constructor(definition: TDefinition);
|
|
9
|
+
abstract getIngredients(): IngredientInput[];
|
|
10
|
+
abstract replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
11
|
+
abstract getResults(): ResultInput[];
|
|
12
|
+
abstract replaceResult(replace: Replacer<Result>): Recipe;
|
|
13
|
+
toJSON(): TDefinition;
|
|
14
|
+
getTypes(): string[];
|
|
15
|
+
}
|
|
16
|
+
export type InlineRecipeParser = <TDefinition extends RecipeDefinition>(definition: TDefinition) => Recipe<TDefinition>;
|
|
17
|
+
export default abstract class RecipeParser<TDefinition extends RecipeDefinition, TRecipe extends Recipe> {
|
|
18
|
+
abstract create(definition: TDefinition, parse: InlineRecipeParser): TRecipe;
|
|
19
|
+
}
|