@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,35 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import type { BlockIngredient, Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
|
-
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type { Block, Result, ResultInput } from "../../../common/result.js";
|
|
6
|
-
export type BlockOutput = string | Readonly<{
|
|
7
|
-
name: string;
|
|
8
|
-
}>;
|
|
9
|
-
export type BlockInput = Readonly<{
|
|
10
|
-
type: "block";
|
|
11
|
-
block: string;
|
|
12
|
-
}> | Readonly<{
|
|
13
|
-
type: "tag";
|
|
14
|
-
tag: string;
|
|
15
|
-
}>;
|
|
16
|
-
export type OrechidRecipeDefinition = RecipeDefinition & Readonly<{
|
|
17
|
-
input: BlockInput;
|
|
18
|
-
output: BlockInput;
|
|
1
|
+
import BotaniaBlockRecipeParser, { type BotaniaBlockRecipeDefinition } from "./blocks.js";
|
|
2
|
+
export type OrechidRecipeDefinition = BotaniaBlockRecipeDefinition & Readonly<{
|
|
19
3
|
biome_bonus?: number;
|
|
20
4
|
biome_bonus_tag?: string;
|
|
21
5
|
weight?: number;
|
|
22
6
|
}>;
|
|
23
|
-
export declare
|
|
24
|
-
export declare function createBlockOutput(input: ResultInput): BlockOutput | null;
|
|
25
|
-
export declare function fromBlockInput(input: BlockInput): BlockIngredient;
|
|
26
|
-
export declare function fromBlockOutput(output: BlockOutput): Block;
|
|
27
|
-
export declare class OrechidRecipe extends Recipe<OrechidRecipeDefinition> {
|
|
28
|
-
getIngredients(): IngredientInput[];
|
|
29
|
-
getResults(): ResultInput[];
|
|
30
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
31
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
32
|
-
}
|
|
33
|
-
export default class OrechidRecipeParser extends RecipeParser<OrechidRecipeDefinition, OrechidRecipe> {
|
|
34
|
-
create(definition: OrechidRecipeDefinition): OrechidRecipe;
|
|
7
|
+
export declare class OrechidRecipeParser extends BotaniaBlockRecipeParser<OrechidRecipeDefinition> {
|
|
35
8
|
}
|
|
@@ -1,74 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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
|
-
}
|
|
1
|
+
import BotaniaBlockRecipeParser, {} from "./blocks.js";
|
|
2
|
+
export class OrechidRecipeParser extends BotaniaBlockRecipeParser {
|
|
73
3
|
}
|
|
74
4
|
//# sourceMappingURL=orechid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orechid.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/orechid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orechid.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/orechid.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,EAAE,EAEhC,MAAM,aAAa,CAAC;AASrB,MAAM,OAAO,mBAAoB,SAAQ,wBAAiD;CAAG"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
1
|
+
import BotaniaBlockRecipeParser, { type BotaniaBlockRecipeDefinition } from "./blocks.js";
|
|
2
|
+
export type PureDaisyRecipeDefinition = BotaniaBlockRecipeDefinition;
|
|
3
|
+
export declare class PureDaisyRecipeParser extends BotaniaBlockRecipeParser<PureDaisyRecipeDefinition> {
|
|
19
4
|
}
|
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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
|
-
}
|
|
1
|
+
import BotaniaBlockRecipeParser, {} from "./blocks.js";
|
|
2
|
+
export class PureDaisyRecipeParser extends BotaniaBlockRecipeParser {
|
|
29
3
|
}
|
|
30
4
|
//# sourceMappingURL=pureDaisy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDaisy.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/pureDaisy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pureDaisy.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/pureDaisy.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,EAAE,EAEhC,MAAM,aAAa,CAAC;AAIrB,MAAM,OAAO,qBAAsB,SAAQ,wBAAmD;CAAG"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import type { Replacer } from "../index.js";
|
|
2
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
1
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import
|
|
2
|
+
import RecipeParser, { type RecipeParseContext } from "../index.js";
|
|
3
|
+
import { ManyToOneRecipe } from "../manyToOne.js";
|
|
6
4
|
export type RunicAltarRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredients:
|
|
8
|
-
output:
|
|
5
|
+
ingredients: unknown[];
|
|
6
|
+
output: unknown;
|
|
9
7
|
mana: number;
|
|
10
8
|
}>;
|
|
11
|
-
export declare class RunicAltarRecipe extends
|
|
12
|
-
|
|
13
|
-
getResults(): ResultInput[];
|
|
14
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
15
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
9
|
+
export declare class RunicAltarRecipe extends ManyToOneRecipe {
|
|
10
|
+
serialize(context: RecipeParseContext): Partial<RunicAltarRecipeDefinition>;
|
|
16
11
|
}
|
|
17
|
-
export
|
|
18
|
-
|
|
12
|
+
export declare class RunicAltarRecipeParser extends RecipeParser<RunicAltarRecipeDefinition, RunicAltarRecipe> {
|
|
13
|
+
deserialize(definition: RunicAltarRecipeDefinition, context: RecipeParseContext): RunicAltarRecipe;
|
|
19
14
|
}
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import RecipeParser, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
});
|
|
1
|
+
import RecipeParser, {} from "../index.js";
|
|
2
|
+
import { ManyToOneRecipe } from "../manyToOne.js";
|
|
3
|
+
export class RunicAltarRecipe extends ManyToOneRecipe {
|
|
4
|
+
serialize(context) {
|
|
5
|
+
const { result, ...rest } = super.serialize(context);
|
|
6
|
+
return { ...rest, output: result };
|
|
20
7
|
}
|
|
21
8
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
export class RunicAltarRecipeParser extends RecipeParser {
|
|
10
|
+
deserialize(definition, context) {
|
|
11
|
+
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
12
|
+
const result = context.results.create(definition.output);
|
|
13
|
+
return new RunicAltarRecipe(definition, ingredients, result);
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
//# sourceMappingURL=runicAltar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runicAltar.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/runicAltar.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"runicAltar.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/runicAltar.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAA2B,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AASlD,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAC1C,SAAS,CAChB,OAA2B;QAE3B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACrD,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACrC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,gBAAgB,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
|
@@ -1,19 +1,7 @@
|
|
|
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 TerraPlateRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredients: Ingredient[];
|
|
8
|
-
result: Result;
|
|
1
|
+
import { ManyToOneRecipeParser, type ManyToOneRecipeDefinition } from "../manyToOne.js";
|
|
2
|
+
export type ShapelessRecipeDefinition = ManyToOneRecipeDefinition;
|
|
3
|
+
export type TerraPlateRecipeDefinition = ManyToOneRecipeDefinition & Readonly<{
|
|
9
4
|
mana?: number;
|
|
10
5
|
}>;
|
|
11
|
-
export declare class
|
|
12
|
-
getIngredients(): IngredientInput[];
|
|
13
|
-
getResults(): ResultInput[];
|
|
14
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
15
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
16
|
-
}
|
|
17
|
-
export default class TerraPlateRecipeParser extends RecipeParser<TerraPlateRecipeDefinition, TerraPlateRecipe> {
|
|
18
|
-
create(definition: TerraPlateRecipeDefinition): TerraPlateRecipe;
|
|
6
|
+
export declare class TerraPlateRecipeParser extends ManyToOneRecipeParser<TerraPlateRecipeDefinition> {
|
|
19
7
|
}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export class
|
|
3
|
-
getIngredients() {
|
|
4
|
-
return this.definition.ingredients;
|
|
5
|
-
}
|
|
6
|
-
getResults() {
|
|
7
|
-
return [this.definition.result];
|
|
8
|
-
}
|
|
9
|
-
replaceIngredient(replace) {
|
|
10
|
-
return new 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
|
-
}
|
|
1
|
+
import { ManyToOneRecipeParser, } from "../manyToOne.js";
|
|
2
|
+
export class TerraPlateRecipeParser extends ManyToOneRecipeParser {
|
|
26
3
|
}
|
|
27
4
|
//# sourceMappingURL=terraPlate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terraPlate.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/terraPlate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terraPlate.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/terraPlate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,OAAO,sBAAuB,SAAQ,qBAAiD;CAAG"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import type { Ingredient
|
|
2
|
-
import type { Result
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
3
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
-
import type { Replacer } from "../index.js";
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
5
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
6
|
-
import type { CreateProcessingRecipeDefinition } from "./processing.js";
|
|
7
6
|
export type AssemblyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
8
|
-
ingredient:
|
|
9
|
-
transitionalItem:
|
|
10
|
-
results:
|
|
7
|
+
ingredient: unknown;
|
|
8
|
+
transitionalItem: unknown;
|
|
9
|
+
results: unknown[];
|
|
11
10
|
loops?: number;
|
|
12
|
-
sequence:
|
|
11
|
+
sequence: RecipeDefinition[];
|
|
13
12
|
}>;
|
|
14
|
-
export declare class AssemblyRecipe extends Recipe
|
|
15
|
-
|
|
13
|
+
export declare class AssemblyRecipe extends Recipe {
|
|
14
|
+
private readonly ingredient;
|
|
15
|
+
private readonly transitionalItem;
|
|
16
|
+
private readonly results;
|
|
16
17
|
private readonly sequence;
|
|
17
|
-
constructor(definition:
|
|
18
|
-
getIngredients():
|
|
19
|
-
getResults():
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
constructor(definition: RecipeDefinition, ingredient: Ingredient, transitionalItem: Ingredient, results: Result[], sequence: Recipe[]);
|
|
19
|
+
getIngredients(): Ingredient[];
|
|
20
|
+
getResults(): Result[];
|
|
21
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): AssemblyRecipe;
|
|
22
|
+
serialize(context: RecipeParseContext): Partial<AssemblyRecipeDefinition>;
|
|
22
23
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
24
|
+
export declare class AssemblyRecipeParser extends RecipeParser<AssemblyRecipeDefinition, AssemblyRecipe> {
|
|
25
|
+
deserialize(definition: AssemblyRecipeDefinition, context: RecipeParseContext): AssemblyRecipe;
|
|
25
26
|
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
-
import { CreateProcessingRecipe } from "./processing.js";
|
|
3
2
|
export class AssemblyRecipe extends Recipe {
|
|
4
|
-
|
|
3
|
+
ingredient;
|
|
4
|
+
transitionalItem;
|
|
5
|
+
results;
|
|
5
6
|
sequence;
|
|
6
|
-
constructor(definition) {
|
|
7
|
+
constructor(definition, ingredient, transitionalItem, results, sequence) {
|
|
7
8
|
super(definition);
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
9
|
+
this.ingredient = ingredient;
|
|
10
|
+
this.transitionalItem = transitionalItem;
|
|
11
|
+
this.results = results;
|
|
12
|
+
this.sequence = sequence;
|
|
10
13
|
}
|
|
11
14
|
getIngredients() {
|
|
12
15
|
return [
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
16
|
+
this.ingredient,
|
|
17
|
+
this.transitionalItem,
|
|
15
18
|
...this.sequence.flatMap((it) => it.getIngredients()),
|
|
16
19
|
];
|
|
17
20
|
}
|
|
18
21
|
getResults() {
|
|
19
|
-
return [
|
|
20
|
-
...this.definition.results,
|
|
21
|
-
...this.sequence.flatMap((it) => it.getResults()),
|
|
22
|
-
];
|
|
22
|
+
return [...this.results, ...this.sequence.flatMap((it) => it.getResults())];
|
|
23
23
|
}
|
|
24
|
-
|
|
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
|
-
});
|
|
24
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
25
|
+
return new AssemblyRecipe(this.definition, ingredientReplacer(this.ingredient), ingredientReplacer(this.transitionalItem), this.results.map(resultReplacer), this.sequence.map((it) => it.replace(ingredientReplacer, resultReplacer)));
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
serialize(context) {
|
|
28
|
+
return {
|
|
29
|
+
ingredient: context.ingredients.serialize(this.ingredient),
|
|
30
|
+
transitionalItem: context.ingredients.serialize(this.transitionalItem),
|
|
31
|
+
results: context.ingredients.serializeList(this.results),
|
|
32
|
+
sequence: this.sequence.map((it) => context.recipes.serialize(it)),
|
|
33
|
+
};
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
export class AssemblyRecipeParser extends RecipeParser {
|
|
37
|
+
deserialize(definition, context) {
|
|
38
|
+
const ingredient = context.ingredients.create(definition.ingredient);
|
|
39
|
+
const transitionalItem = context.ingredients.create(definition.transitionalItem);
|
|
40
|
+
const results = context.results.createList(definition.results);
|
|
41
|
+
const sequence = definition.sequence.map((it) => context.recipes.deserialize(it));
|
|
42
|
+
return new AssemblyRecipe(definition, ingredient, transitionalItem, results, sequence);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=assembly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/assembly.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/assembly.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAGrB;IACA;IACA;IACA;IALnB,YACE,UAA4B,EACX,UAAsB,EACtB,gBAA4B,EAC5B,OAAiB,EACjB,QAAkB;QAEnC,KAAK,CAAC,UAAU,CAAC,CAAC;QALD,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAY;QAC5B,YAAO,GAAP,OAAO,CAAU;QACjB,aAAQ,GAAR,QAAQ,CAAU;IAGrC,CAAC;IAED,cAAc;QACZ,OAAO;YACL,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,gBAAgB;YACrB,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,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,cAAc,CACvB,IAAI,CAAC,UAAU,EACf,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACzC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAChC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC,CAC1E,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1D,gBAAgB,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACtE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC;YACxD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;SACnE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,YAGzC;IACC,WAAW,CACT,UAAoC,EACpC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CACjD,UAAU,CAAC,gBAAgB,CAC5B,CAAC;QACF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAC9C,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,CAChC,CAAC;QACF,OAAO,IAAI,cAAc,CACvB,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,QAAQ,CACT,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
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[];
|
|
1
|
+
import type { ManyToManyRecipeDefinition } from "../manyToMany.js";
|
|
2
|
+
import { ManyToManyRecipeParser } from "../manyToMany.js";
|
|
3
|
+
export type CreateProcessingRecipeDefinition = ManyToManyRecipeDefinition & Readonly<{
|
|
9
4
|
heatRequirement?: string;
|
|
10
5
|
processingTime?: number;
|
|
11
6
|
keepHeldItem?: boolean;
|
|
12
7
|
}>;
|
|
13
|
-
export declare class
|
|
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;
|
|
8
|
+
export declare class CreateProcessingRecipeParser extends ManyToManyRecipeParser<CreateProcessingRecipeDefinition> {
|
|
21
9
|
}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export class
|
|
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
|
-
}
|
|
1
|
+
import { ManyToManyRecipeParser } from "../manyToMany.js";
|
|
2
|
+
export class CreateProcessingRecipeParser extends ManyToManyRecipeParser {
|
|
26
3
|
}
|
|
27
4
|
//# sourceMappingURL=processing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/processing.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"processing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/create/processing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAS1D,MAAM,OAAO,4BAA6B,SAAQ,sBAAwD;CAAG"}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import type { Ingredient
|
|
2
|
-
import type { Result
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
3
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
-
import type { Replacer } from "../index.js";
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
5
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type CookingRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredients:
|
|
8
|
-
container?:
|
|
9
|
-
result:
|
|
7
|
+
ingredients: unknown[];
|
|
8
|
+
container?: unknown;
|
|
9
|
+
result: unknown;
|
|
10
10
|
cookingTime?: number;
|
|
11
11
|
experience?: number;
|
|
12
12
|
recipe_book_tab?: string;
|
|
13
13
|
}>;
|
|
14
|
-
export declare class CookingRecipe extends Recipe
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
export declare class CookingRecipe extends Recipe {
|
|
15
|
+
private readonly ingredients;
|
|
16
|
+
private readonly result;
|
|
17
|
+
private readonly container?;
|
|
18
|
+
constructor(definition: RecipeDefinition, ingredients: Ingredient[], result: Result, container?: Ingredient | undefined);
|
|
19
|
+
getIngredients(): Ingredient[];
|
|
20
|
+
getResults(): Result[];
|
|
21
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): CookingRecipe;
|
|
22
|
+
serialize(context: RecipeParseContext): Partial<CookingRecipeDefinition>;
|
|
19
23
|
}
|
|
20
24
|
export default class CookingRecipeParser extends RecipeParser<CookingRecipeDefinition, CookingRecipe> {
|
|
21
|
-
|
|
25
|
+
deserialize(definition: CookingRecipeDefinition, context: RecipeParseContext): CookingRecipe;
|
|
22
26
|
}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
import { exists } from "@adeficior/pack-resolver";
|
|
2
2
|
import RecipeParser, { Recipe } from "../index.js";
|
|
3
3
|
export class CookingRecipe extends Recipe {
|
|
4
|
+
ingredients;
|
|
5
|
+
result;
|
|
6
|
+
container;
|
|
7
|
+
constructor(definition, ingredients, result, container) {
|
|
8
|
+
super(definition);
|
|
9
|
+
this.ingredients = ingredients;
|
|
10
|
+
this.result = result;
|
|
11
|
+
this.container = container;
|
|
12
|
+
}
|
|
4
13
|
getIngredients() {
|
|
5
|
-
return [this.
|
|
14
|
+
return [this.container, ...this.ingredients].filter(exists);
|
|
6
15
|
}
|
|
7
16
|
getResults() {
|
|
8
|
-
return [this.
|
|
17
|
+
return [this.result];
|
|
9
18
|
}
|
|
10
|
-
|
|
11
|
-
return new CookingRecipe(
|
|
12
|
-
...this.definition,
|
|
13
|
-
container: this.definition.container && replace(this.definition.container),
|
|
14
|
-
ingredients: this.definition.ingredients.map(replace),
|
|
15
|
-
});
|
|
19
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
20
|
+
return new CookingRecipe(this.definition, this.ingredients.map(ingredientReplacer), resultReplacer(this.result), this.container && ingredientReplacer(this.container));
|
|
16
21
|
}
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
result:
|
|
21
|
-
|
|
22
|
+
serialize(context) {
|
|
23
|
+
return {
|
|
24
|
+
ingredients: context.ingredients.serializeList(this.ingredients),
|
|
25
|
+
result: context.results.serialize(this.result),
|
|
26
|
+
container: this.container && context.ingredients.serialize(this.container),
|
|
27
|
+
};
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
export default class CookingRecipeParser extends RecipeParser {
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
deserialize(definition, context) {
|
|
32
|
+
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
33
|
+
const result = context.results.create(definition.result);
|
|
34
|
+
// TODO optional serialize & deserialize?
|
|
35
|
+
const container = definition.container === undefined
|
|
36
|
+
? undefined
|
|
37
|
+
: context.ingredients.create(definition.container);
|
|
38
|
+
return new CookingRecipe(definition, ingredients, result, container);
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
41
|
//# sourceMappingURL=cooking.js.map
|