@adeficior/data-modifier 1.0.0-rc.13 → 1.0.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emit/data/recipe.d.ts +6 -5
- package/dist/emit/data/recipe.js +16 -8
- package/dist/emit/data/recipe.js.map +1 -1
- package/dist/emit/rule/recipe.d.ts +4 -4
- package/dist/emit/rule/recipe.js.map +1 -1
- package/dist/loader/recipe.d.ts +3 -3
- package/dist/loader/recipe.js +4 -5
- package/dist/loader/recipe.js.map +1 -1
- package/dist/parser/index.d.ts +1 -1
- package/dist/parser/index.js +1 -1
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/recipe/adAstra/conversion.d.ts +1 -1
- package/dist/parser/recipe/adAstra/conversion.js +4 -4
- package/dist/parser/recipe/adAstra/conversion.js.map +1 -1
- package/dist/parser/recipe/adAstra/inputOutput.d.ts +1 -1
- package/dist/parser/recipe/adAstra/inputOutput.js +4 -4
- package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -1
- package/dist/parser/recipe/adAstra/spaceStation.d.ts +1 -1
- package/dist/parser/recipe/adAstra/spaceStation.js +4 -4
- package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -1
- package/dist/parser/recipe/botania/apothecary.d.ts +1 -1
- package/dist/parser/recipe/botania/apothecary.js +4 -4
- package/dist/parser/recipe/botania/apothecary.js.map +1 -1
- package/dist/parser/recipe/botania/blocks.js +1 -1
- package/dist/parser/recipe/botania/blocks.js.map +1 -1
- package/dist/parser/recipe/botania/brew.d.ts +1 -1
- package/dist/parser/recipe/botania/brew.js +4 -4
- package/dist/parser/recipe/botania/brew.js.map +1 -1
- package/dist/parser/recipe/botania/elvenTrade.js +1 -1
- package/dist/parser/recipe/botania/elvenTrade.js.map +1 -1
- package/dist/parser/recipe/botania/gogWrapper.d.ts +2 -2
- package/dist/parser/recipe/botania/gogWrapper.js +4 -4
- package/dist/parser/recipe/botania/gogWrapper.js.map +1 -1
- package/dist/parser/recipe/botania/manaInfusion.d.ts +1 -1
- package/dist/parser/recipe/botania/manaInfusion.js +4 -4
- package/dist/parser/recipe/botania/manaInfusion.js.map +1 -1
- package/dist/parser/recipe/botania/nbtWrapper.d.ts +2 -2
- package/dist/parser/recipe/botania/nbtWrapper.js +4 -4
- package/dist/parser/recipe/botania/nbtWrapper.js.map +1 -1
- package/dist/parser/recipe/botania/runicAltar.js +1 -1
- package/dist/parser/recipe/botania/runicAltar.js.map +1 -1
- package/dist/parser/recipe/create/assembly.d.ts +2 -2
- package/dist/parser/recipe/create/assembly.js +4 -4
- package/dist/parser/recipe/create/assembly.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cooking.d.ts +1 -1
- package/dist/parser/recipe/farmersdelight/cooking.js +4 -4
- package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cutting.d.ts +1 -2
- package/dist/parser/recipe/farmersdelight/cutting.js +4 -4
- package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -1
- package/dist/parser/recipe/forge/conditional.d.ts +3 -3
- package/dist/parser/recipe/forge/conditional.js +5 -5
- package/dist/parser/recipe/forge/conditional.js.map +1 -1
- package/dist/parser/recipe/index.d.ts +21 -7
- package/dist/parser/recipe/index.js +30 -4
- package/dist/parser/recipe/index.js.map +1 -1
- package/dist/parser/recipe/manyToMany.d.ts +1 -1
- package/dist/parser/recipe/manyToMany.js +4 -4
- package/dist/parser/recipe/manyToMany.js.map +1 -1
- package/dist/parser/recipe/manyToOne.d.ts +1 -1
- package/dist/parser/recipe/manyToOne.js +4 -4
- package/dist/parser/recipe/manyToOne.js.map +1 -1
- package/dist/parser/recipe/oneToOne.d.ts +1 -1
- package/dist/parser/recipe/oneToOne.js +4 -4
- package/dist/parser/recipe/oneToOne.js.map +1 -1
- package/dist/parser/recipe/roots/component.d.ts +1 -1
- package/dist/parser/recipe/roots/component.js +4 -4
- package/dist/parser/recipe/roots/component.js.map +1 -1
- package/dist/parser/recipe/roots/ritual.d.ts +1 -2
- package/dist/parser/recipe/roots/ritual.js +4 -4
- package/dist/parser/recipe/roots/ritual.js.map +1 -1
- package/dist/parser/recipe/thermal/catalyst.d.ts +1 -1
- package/dist/parser/recipe/thermal/catalyst.js +4 -4
- package/dist/parser/recipe/thermal/catalyst.js.map +1 -1
- package/dist/parser/recipe/thermal/fuel.d.ts +1 -1
- package/dist/parser/recipe/thermal/fuel.js +4 -4
- package/dist/parser/recipe/thermal/fuel.js.map +1 -1
- package/dist/parser/recipe/thermal/index.d.ts +1 -1
- package/dist/parser/recipe/thermal/index.js +4 -4
- package/dist/parser/recipe/thermal/index.js.map +1 -1
- package/dist/parser/recipe/thermal/treeExtraction.d.ts +1 -1
- package/dist/parser/recipe/thermal/treeExtraction.js +4 -4
- package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -1
- package/dist/parser/recipe/vanilla/shaped.d.ts +1 -1
- package/dist/parser/recipe/vanilla/shaped.js +4 -4
- package/dist/parser/recipe/vanilla/shaped.js.map +1 -1
- package/dist/parser/recipe/vanilla/smelting.d.ts +1 -1
- package/dist/parser/recipe/vanilla/smelting.js +4 -4
- package/dist/parser/recipe/vanilla/smelting.js.map +1 -1
- package/dist/parser/recipe/vanilla/smithing.d.ts +1 -1
- package/dist/parser/recipe/vanilla/smithing.js +4 -4
- package/dist/parser/recipe/vanilla/smithing.js.map +1 -1
- package/dist/parser/recipe/vanilla/stonecutting.d.ts +1 -1
- package/dist/parser/recipe/vanilla/stonecutting.js +4 -4
- package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gogWrapper.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/gogWrapper.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,MAAM,OAAO,gBAAiB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,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1D,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -13,7 +13,7 @@ export declare class ManaInfusionRecipe extends Recipe {
|
|
|
13
13
|
private readonly ingredient;
|
|
14
14
|
private readonly result;
|
|
15
15
|
private readonly catalyst?;
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(ingredient: Ingredient, result: Result, catalyst?: Ingredient | undefined);
|
|
17
17
|
getIngredients(): Ingredient[];
|
|
18
18
|
getResults(): Result[];
|
|
19
19
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ManaInfusionRecipe;
|
|
@@ -5,8 +5,8 @@ export class ManaInfusionRecipe extends Recipe {
|
|
|
5
5
|
ingredient;
|
|
6
6
|
result;
|
|
7
7
|
catalyst;
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
8
|
+
constructor(ingredient, result, catalyst) {
|
|
9
|
+
super();
|
|
10
10
|
this.ingredient = ingredient;
|
|
11
11
|
this.result = result;
|
|
12
12
|
this.catalyst = catalyst;
|
|
@@ -18,7 +18,7 @@ export class ManaInfusionRecipe extends Recipe {
|
|
|
18
18
|
return [this.result];
|
|
19
19
|
}
|
|
20
20
|
replace(ingredientReplacer, resultReplacer) {
|
|
21
|
-
return new ManaInfusionRecipe(
|
|
21
|
+
return new ManaInfusionRecipe(ingredientReplacer(this.ingredient), resultReplacer(this.result), this.catalyst && ingredientReplacer(this.catalyst));
|
|
22
22
|
}
|
|
23
23
|
serialize(context) {
|
|
24
24
|
return {
|
|
@@ -35,7 +35,7 @@ export class ManaInfusionRecipeParser extends RecipeParser {
|
|
|
35
35
|
: deserializeBlockInput(context.ingredients, definition.catalyst);
|
|
36
36
|
const ingredient = context.ingredients.create(definition.input);
|
|
37
37
|
const result = context.results.create(definition.output);
|
|
38
|
-
return new ManaInfusionRecipe(
|
|
38
|
+
return new ManaInfusionRecipe(ingredient, result, catalyst);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=manaInfusion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manaInfusion.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/manaInfusion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKlD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAUzE,MAAM,OAAO,kBAAmB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"manaInfusion.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/manaInfusion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKlD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAUzE,MAAM,OAAO,kBAAmB,SAAQ,MAAM;IAEzB;IACA;IACA;IAHnB,YACmB,UAAsB,EACtB,MAAc,EACd,QAAqB;QAEtC,KAAK,EAAE,CAAC;QAJS,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAa;IAGxC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,kBAAkB,CAC3B,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAC3B,IAAI,CAAC,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CACnD,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YACrD,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC;SAC9D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,wBAAyB,SAAQ,YAG7C;IACC,WAAW,CACT,UAAwC,EACxC,OAA2B;QAE3B,MAAM,QAAQ,GACZ,UAAU,CAAC,QAAQ,KAAK,SAAS;YAC/B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,qBAAqB,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
2
|
import type { Result } from "../../../common/result/index.js";
|
|
3
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
-
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import type { RecipeHolder, RecipeParseContext, Replacer } from "../index.js";
|
|
5
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type NbtWrapperRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
7
|
nbt: string;
|
|
@@ -9,7 +9,7 @@ export type NbtWrapperRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
9
9
|
}>;
|
|
10
10
|
export declare class NbtWrapperRecipe extends Recipe {
|
|
11
11
|
private readonly recipe;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(recipe: RecipeHolder);
|
|
13
13
|
getIngredients(): Ingredient[];
|
|
14
14
|
getResults(): Result[];
|
|
15
15
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): Recipe;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class NbtWrapperRecipe extends Recipe {
|
|
3
3
|
recipe;
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(recipe) {
|
|
5
|
+
super();
|
|
6
6
|
this.recipe = recipe;
|
|
7
7
|
}
|
|
8
8
|
getIngredients() {
|
|
@@ -12,7 +12,7 @@ export class NbtWrapperRecipe extends Recipe {
|
|
|
12
12
|
return this.recipe.getResults();
|
|
13
13
|
}
|
|
14
14
|
replace(ingredientReplacer, resultReplacer) {
|
|
15
|
-
return new NbtWrapperRecipe(this.
|
|
15
|
+
return new NbtWrapperRecipe(this.recipe.replace(ingredientReplacer, resultReplacer));
|
|
16
16
|
}
|
|
17
17
|
serialize(context) {
|
|
18
18
|
return {
|
|
@@ -23,7 +23,7 @@ export class NbtWrapperRecipe extends Recipe {
|
|
|
23
23
|
export class NbtWrapperRecipeParser extends RecipeParser {
|
|
24
24
|
deserialize(definition, context) {
|
|
25
25
|
const recipe = context.recipes.deserialize(definition.recipe);
|
|
26
|
-
return new NbtWrapperRecipe(
|
|
26
|
+
return new NbtWrapperRecipe(recipe);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=nbtWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nbtWrapper.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/nbtWrapper.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,gBAAiB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"nbtWrapper.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/nbtWrapper.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,gBAAiB,SAAQ,MAAM;IACb;IAA7B,YAA6B,MAAoB;QAC/C,KAAK,EAAE,CAAC;QADmB,WAAM,GAAN,MAAM,CAAc;IAEjD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;IACtC,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC,CACxD,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -10,7 +10,7 @@ export class RunicAltarRecipeParser extends RecipeParser {
|
|
|
10
10
|
deserialize(definition, context) {
|
|
11
11
|
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
12
12
|
const result = context.results.create(definition.output);
|
|
13
|
-
return new RunicAltarRecipe(
|
|
13
|
+
return new RunicAltarRecipe(ingredients, result);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
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,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,
|
|
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,WAAW,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
2
|
import type { Result } from "../../../common/result/index.js";
|
|
3
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
-
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import type { RecipeHolder, RecipeParseContext, Replacer } from "../index.js";
|
|
5
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type AssemblyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
7
|
ingredient: unknown;
|
|
@@ -15,7 +15,7 @@ export declare class AssemblyRecipe extends Recipe {
|
|
|
15
15
|
private readonly transitionalItem;
|
|
16
16
|
private readonly results;
|
|
17
17
|
private readonly sequence;
|
|
18
|
-
constructor(
|
|
18
|
+
constructor(ingredient: Ingredient, transitionalItem: Ingredient, results: Result[], sequence: RecipeHolder[]);
|
|
19
19
|
getIngredients(): Ingredient[];
|
|
20
20
|
getResults(): Result[];
|
|
21
21
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): AssemblyRecipe;
|
|
@@ -4,8 +4,8 @@ export class AssemblyRecipe extends Recipe {
|
|
|
4
4
|
transitionalItem;
|
|
5
5
|
results;
|
|
6
6
|
sequence;
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
7
|
+
constructor(ingredient, transitionalItem, results, sequence) {
|
|
8
|
+
super();
|
|
9
9
|
this.ingredient = ingredient;
|
|
10
10
|
this.transitionalItem = transitionalItem;
|
|
11
11
|
this.results = results;
|
|
@@ -22,7 +22,7 @@ export class AssemblyRecipe extends Recipe {
|
|
|
22
22
|
return [...this.results, ...this.sequence.flatMap((it) => it.getResults())];
|
|
23
23
|
}
|
|
24
24
|
replace(ingredientReplacer, resultReplacer) {
|
|
25
|
-
return new AssemblyRecipe(
|
|
25
|
+
return new AssemblyRecipe(ingredientReplacer(this.ingredient), ingredientReplacer(this.transitionalItem), this.results.map(resultReplacer), this.sequence.map((it) => it.replace(ingredientReplacer, resultReplacer)));
|
|
26
26
|
}
|
|
27
27
|
serialize(context) {
|
|
28
28
|
return {
|
|
@@ -39,7 +39,7 @@ export class AssemblyRecipeParser extends RecipeParser {
|
|
|
39
39
|
const transitionalItem = context.ingredients.create(definition.transitionalItem);
|
|
40
40
|
const results = context.results.createList(definition.results);
|
|
41
41
|
const sequence = definition.sequence.map((it) => context.recipes.deserialize(it));
|
|
42
|
-
return new AssemblyRecipe(
|
|
42
|
+
return new AssemblyRecipe(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":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWnD,MA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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,CAAC,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -15,7 +15,7 @@ export declare class CookingRecipe extends Recipe {
|
|
|
15
15
|
private readonly ingredients;
|
|
16
16
|
private readonly result;
|
|
17
17
|
private readonly container?;
|
|
18
|
-
constructor(
|
|
18
|
+
constructor(ingredients: Ingredient[], result: Result, container?: Ingredient | undefined);
|
|
19
19
|
getIngredients(): Ingredient[];
|
|
20
20
|
getResults(): Result[];
|
|
21
21
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): CookingRecipe;
|
|
@@ -4,8 +4,8 @@ export class CookingRecipe extends Recipe {
|
|
|
4
4
|
ingredients;
|
|
5
5
|
result;
|
|
6
6
|
container;
|
|
7
|
-
constructor(
|
|
8
|
-
super(
|
|
7
|
+
constructor(ingredients, result, container) {
|
|
8
|
+
super();
|
|
9
9
|
this.ingredients = ingredients;
|
|
10
10
|
this.result = result;
|
|
11
11
|
this.container = container;
|
|
@@ -17,7 +17,7 @@ export class CookingRecipe extends Recipe {
|
|
|
17
17
|
return [this.result];
|
|
18
18
|
}
|
|
19
19
|
replace(ingredientReplacer, resultReplacer) {
|
|
20
|
-
return new CookingRecipe(this.
|
|
20
|
+
return new CookingRecipe(this.ingredients.map(ingredientReplacer), resultReplacer(this.result), this.container && ingredientReplacer(this.container));
|
|
21
21
|
}
|
|
22
22
|
serialize(context) {
|
|
23
23
|
return {
|
|
@@ -35,7 +35,7 @@ export default class CookingRecipeParser extends RecipeParser {
|
|
|
35
35
|
const container = definition.container === undefined
|
|
36
36
|
? undefined
|
|
37
37
|
: context.ingredients.create(definition.container);
|
|
38
|
-
return new CookingRecipe(
|
|
38
|
+
return new CookingRecipe(ingredients, result, container);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=cooking.js.map
|
|
@@ -1 +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;AAKlD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,aAAc,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"cooking.js","sourceRoot":"","sources":["../../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W,CACT,UAAmC,EACnC,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,yCAAyC;QACzC,MAAM,SAAS,GACb,UAAU,CAAC,SAAS,KAAK,SAAS;YAChC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QACvD,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
2
|
import type { Result } from "../../../common/result/index.js";
|
|
3
|
-
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
3
|
import RecipeParser, { type RecipeParseContext, type Replacer } from "../index.js";
|
|
5
4
|
import { ManyToManyRecipe, type ManyToManyRecipeDefinition } from "../manyToMany.js";
|
|
6
5
|
export type ToolInput = Readonly<{
|
|
@@ -13,7 +12,7 @@ export type CuttingRecipeDefinition = Omit<ManyToManyRecipeDefinition, "results"
|
|
|
13
12
|
}>;
|
|
14
13
|
export declare class CuttingRecipe extends ManyToManyRecipe {
|
|
15
14
|
private readonly tool;
|
|
16
|
-
constructor(
|
|
15
|
+
constructor(ingredients: Ingredient[], results: Result[], tool: Ingredient);
|
|
17
16
|
getIngredients(): Ingredient[];
|
|
18
17
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): CuttingRecipe;
|
|
19
18
|
serialize(context: RecipeParseContext): Partial<CuttingRecipeDefinition>;
|
|
@@ -11,15 +11,15 @@ import { ManyToManyRecipe, } from "../manyToMany.js";
|
|
|
11
11
|
// }
|
|
12
12
|
export class CuttingRecipe extends ManyToManyRecipe {
|
|
13
13
|
tool;
|
|
14
|
-
constructor(
|
|
15
|
-
super(
|
|
14
|
+
constructor(ingredients, results, tool) {
|
|
15
|
+
super(ingredients, results);
|
|
16
16
|
this.tool = tool;
|
|
17
17
|
}
|
|
18
18
|
getIngredients() {
|
|
19
19
|
return [...super.getIngredients(), this.tool];
|
|
20
20
|
}
|
|
21
21
|
replace(ingredientReplacer, resultReplacer) {
|
|
22
|
-
return new CuttingRecipe(this.
|
|
22
|
+
return new CuttingRecipe(this.ingredients.map(ingredientReplacer), this.results.map(resultReplacer), ingredientReplacer(this.tool));
|
|
23
23
|
}
|
|
24
24
|
serialize(context) {
|
|
25
25
|
const { results, ...rest } = super.serialize(context);
|
|
@@ -35,7 +35,7 @@ export default class CuttingRecipeParser extends RecipeParser {
|
|
|
35
35
|
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
36
36
|
const result = context.results.createList(definition.result);
|
|
37
37
|
const tool = context.ingredients.create(definition.tool);
|
|
38
|
-
return new CuttingRecipe(
|
|
38
|
+
return new CuttingRecipe(ingredients, result, tool);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=cutting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/farmersdelight/cutting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/farmersdelight/cutting.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,EAAE,EAGpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,GAEjB,MAAM,kBAAkB,CAAC;AAgB1B,2BAA2B;AAC3B,sEAAsE;AACtE,aAAa;AACb,iBAAiB;AACjB,mCAAmC;AACnC,yBAAyB;AACzB,kDAAkD;AAClD,OAAO;AACP,IAAI;AAEJ,MAAM,OAAO,aAAc,SAAQ,gBAAg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CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
2
|
import type { Result } from "../../../common/result/index.js";
|
|
3
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
4
|
-
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import type { RecipeHolder, RecipeParseContext, Replacer } from "../index.js";
|
|
5
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
type WithConditions<T> = {
|
|
7
7
|
conditions: unknown[];
|
|
@@ -12,12 +12,12 @@ export type ForgeConditionalRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
12
12
|
}>;
|
|
13
13
|
export declare class ForgeConditionalRecipe extends Recipe {
|
|
14
14
|
private readonly recipes;
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(recipes: WithConditions<RecipeHolder>[]);
|
|
16
16
|
getIngredients(): Ingredient[];
|
|
17
17
|
getResults(): Result[];
|
|
18
18
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ForgeConditionalRecipe;
|
|
19
19
|
serialize(context: RecipeParseContext): Partial<ForgeConditionalRecipeDefinition>;
|
|
20
|
-
|
|
20
|
+
additionalTypes(): `${string}:${string}`[];
|
|
21
21
|
}
|
|
22
22
|
export default class ForgeConditionalRecipeParser extends RecipeParser<ForgeConditionalRecipeDefinition, ForgeConditionalRecipe> {
|
|
23
23
|
deserialize(definition: ForgeConditionalRecipeDefinition, context: RecipeParseContext): ForgeConditionalRecipe;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class ForgeConditionalRecipe extends Recipe {
|
|
3
3
|
recipes;
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(recipes) {
|
|
5
|
+
super();
|
|
6
6
|
this.recipes = recipes;
|
|
7
7
|
}
|
|
8
8
|
getIngredients() {
|
|
@@ -12,7 +12,7 @@ export class ForgeConditionalRecipe extends Recipe {
|
|
|
12
12
|
return this.recipes.flatMap((it) => it.recipe.getResults());
|
|
13
13
|
}
|
|
14
14
|
replace(ingredientReplacer, resultReplacer) {
|
|
15
|
-
return new ForgeConditionalRecipe(this.
|
|
15
|
+
return new ForgeConditionalRecipe(this.recipes.map((it) => ({
|
|
16
16
|
...it,
|
|
17
17
|
recipe: it.recipe.replace(ingredientReplacer, resultReplacer),
|
|
18
18
|
})));
|
|
@@ -25,7 +25,7 @@ export class ForgeConditionalRecipe extends Recipe {
|
|
|
25
25
|
})),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
additionalTypes() {
|
|
29
29
|
return this.recipes.flatMap((it) => it.recipe.getTypes());
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -35,7 +35,7 @@ export default class ForgeConditionalRecipeParser extends RecipeParser {
|
|
|
35
35
|
conditions: it.conditions,
|
|
36
36
|
recipe: context.recipes.deserialize(it.recipe),
|
|
37
37
|
}));
|
|
38
|
-
return new ForgeConditionalRecipe(
|
|
38
|
+
return new ForgeConditionalRecipe(recipes);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=conditional.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../../src/parser/recipe/forge/conditional.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,sBAAuB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../../src/parser/recipe/forge/conditional.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,sBAAuB,SAAQ,MAAM;IACnB;IAA7B,YAA6B,OAAuC;QAClE,KAAK,EAAE,CAAC;QADmB,YAA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AAC;YACP,UAAU,EAAE,EAAE,CAAC,UAAU;YACzB,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC;SAC/C,CAAC,CACH,CAAC;QAEF,OAAO,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type NormalizedId } from "../../common/id.js";
|
|
1
2
|
import type { Ingredient } from "../../common/ingredient/index.js";
|
|
2
3
|
import type { Predicate } from "../../common/predicates.js";
|
|
3
4
|
import type { Result } from "../../common/result/index.js";
|
|
@@ -5,20 +6,33 @@ import type { PackContext } from "../../loader/context.js";
|
|
|
5
6
|
import type { RecipeDefinition } from "../../schema/data/recipe.js";
|
|
6
7
|
export type Replacer<T> = (value: T) => T;
|
|
7
8
|
export declare function createReplacer<T>(from: Predicate<T>, to: T): Replacer<T>;
|
|
9
|
+
export declare class RecipeHolder {
|
|
10
|
+
private readonly definition;
|
|
11
|
+
private readonly recipe;
|
|
12
|
+
private readonly type;
|
|
13
|
+
constructor(definition: RecipeDefinition, recipe: Recipe);
|
|
14
|
+
serialize(context: RecipeParseContext): {
|
|
15
|
+
type: import("@adeficior/data-modifier/generated").RecipeSerializerId;
|
|
16
|
+
conditions?: import("../../index.js").ForgeCondition[];
|
|
17
|
+
"fabric:load_conditions"?: import("../../index.js").FabricCondition[];
|
|
18
|
+
};
|
|
19
|
+
getIngredients(): Ingredient[];
|
|
20
|
+
getResults(): Result[];
|
|
21
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): RecipeHolder;
|
|
22
|
+
replaceIngredient(replace: Replacer<Ingredient>): RecipeHolder;
|
|
23
|
+
replaceResult(replace: Replacer<Result>): RecipeHolder;
|
|
24
|
+
getTypes(): NormalizedId[];
|
|
25
|
+
}
|
|
8
26
|
export declare abstract class Recipe {
|
|
9
|
-
readonly definition: RecipeDefinition;
|
|
10
|
-
constructor(definition: RecipeDefinition);
|
|
11
27
|
abstract getIngredients(): Ingredient[];
|
|
12
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
13
28
|
abstract getResults(): Result[];
|
|
14
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
15
29
|
abstract replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): Recipe;
|
|
16
|
-
|
|
30
|
+
additionalTypes(): NormalizedId[];
|
|
17
31
|
abstract serialize(context: RecipeParseContext): Partial<RecipeDefinition>;
|
|
18
32
|
}
|
|
19
33
|
export type RecipeSerializer = {
|
|
20
|
-
deserialize(definition: RecipeDefinition):
|
|
21
|
-
serialize(recipe:
|
|
34
|
+
deserialize(definition: RecipeDefinition): RecipeHolder;
|
|
35
|
+
serialize(recipe: RecipeHolder): RecipeDefinition;
|
|
22
36
|
};
|
|
23
37
|
export type RecipeParseContext = Pick<PackContext, "ingredients" | "results"> & {
|
|
24
38
|
recipes: RecipeSerializer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { encodeId } from "../../common/id.js";
|
|
1
2
|
export function createReplacer(from, to) {
|
|
2
3
|
return (it) => {
|
|
3
4
|
if (from(it))
|
|
@@ -8,11 +9,31 @@ export function createReplacer(from, to) {
|
|
|
8
9
|
function keep() {
|
|
9
10
|
return (t) => t;
|
|
10
11
|
}
|
|
11
|
-
export class
|
|
12
|
+
export class RecipeHolder {
|
|
12
13
|
definition;
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
recipe;
|
|
15
|
+
type;
|
|
16
|
+
constructor(definition, recipe) {
|
|
15
17
|
this.definition = definition;
|
|
18
|
+
this.recipe = recipe;
|
|
19
|
+
this.type = encodeId(definition.type);
|
|
20
|
+
}
|
|
21
|
+
serialize(context) {
|
|
22
|
+
return {
|
|
23
|
+
...this.definition,
|
|
24
|
+
...this.recipe.serialize(context),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
getIngredients() {
|
|
28
|
+
return this.recipe.getIngredients();
|
|
29
|
+
}
|
|
30
|
+
getResults() {
|
|
31
|
+
return this.recipe.getResults();
|
|
32
|
+
}
|
|
33
|
+
// TODO rename modifiy & add modifier object
|
|
34
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
35
|
+
const modified = this.recipe.replace(ingredientReplacer, resultReplacer);
|
|
36
|
+
return new RecipeHolder(this.definition, modified);
|
|
16
37
|
}
|
|
17
38
|
replaceIngredient(replace) {
|
|
18
39
|
return this.replace(replace, keep());
|
|
@@ -21,7 +42,12 @@ export class Recipe {
|
|
|
21
42
|
return this.replace(keep(), replace);
|
|
22
43
|
}
|
|
23
44
|
getTypes() {
|
|
24
|
-
return [this.
|
|
45
|
+
return [this.type, ...this.recipe.additionalTypes()];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class Recipe {
|
|
49
|
+
additionalTypes() {
|
|
50
|
+
return [];
|
|
25
51
|
}
|
|
26
52
|
}
|
|
27
53
|
export default class RecipeParser {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parser/recipe/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parser/recipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AASjE,MAAM,UAAU,cAAc,CAAI,IAAkB,EAAE,EAAK;IACzD,OAAO,CAAC,EAAK,EAAE,EAAE;QACf,IAAI,IAAI,CAAC,EAAE,CAAC;YAAE,OAAO,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,IAAI;IACX,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,OAAO,YAAY;IAIJ;IACA;IAJF,IAAI,CAAe;IAEpC,YACmB,UAA4B,EAC5B,MAAc;QADd,eAAU,GAA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ipe extends Recipe {
|
|
10
10
|
protected readonly ingredients: Ingredient[];
|
|
11
11
|
protected readonly results: Result[];
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(ingredients: Ingredient[], results: Result[]);
|
|
13
13
|
getIngredients(): Ingredient[];
|
|
14
14
|
getResults(): Result[];
|
|
15
15
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ManyToManyRecipe;
|
|
@@ -2,8 +2,8 @@ import RecipeParser, { Recipe, } from "./index.js";
|
|
|
2
2
|
export class ManyToManyRecipe extends Recipe {
|
|
3
3
|
ingredients;
|
|
4
4
|
results;
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
5
|
+
constructor(ingredients, results) {
|
|
6
|
+
super();
|
|
7
7
|
this.ingredients = ingredients;
|
|
8
8
|
this.results = results;
|
|
9
9
|
}
|
|
@@ -14,7 +14,7 @@ export class ManyToManyRecipe extends Recipe {
|
|
|
14
14
|
return this.results;
|
|
15
15
|
}
|
|
16
16
|
replace(ingredientReplacer, resultReplacer) {
|
|
17
|
-
return new ManyToManyRecipe(this.
|
|
17
|
+
return new ManyToManyRecipe(this.ingredients.map(ingredientReplacer), this.results.map(resultReplacer));
|
|
18
18
|
}
|
|
19
19
|
serialize(context) {
|
|
20
20
|
return {
|
|
@@ -27,7 +27,7 @@ export class ManyToManyRecipeParser extends RecipeParser {
|
|
|
27
27
|
deserialize(definition, context) {
|
|
28
28
|
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
29
29
|
const results = context.results.createList(definition.results);
|
|
30
|
-
return new ManyToManyRecipe(
|
|
30
|
+
return new ManyToManyRecipe(ingredients, results);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=manyToMany.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/parser/recipe/manyToMany.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GA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C,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -9,7 +9,7 @@ export type ManyToOneRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
9
9
|
export declare class ManyToOneRecipe extends Recipe {
|
|
10
10
|
protected readonly ingredients: Ingredient[];
|
|
11
11
|
protected readonly result: Result;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(ingredients: Ingredient[], result: Result);
|
|
13
13
|
getIngredients(): Ingredient[];
|
|
14
14
|
getResults(): Result[];
|
|
15
15
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ManyToOneRecipe;
|
|
@@ -2,8 +2,8 @@ import RecipeParser, { Recipe, } from "./index.js";
|
|
|
2
2
|
export class ManyToOneRecipe extends Recipe {
|
|
3
3
|
ingredients;
|
|
4
4
|
result;
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
5
|
+
constructor(ingredients, result) {
|
|
6
|
+
super();
|
|
7
7
|
this.ingredients = ingredients;
|
|
8
8
|
this.result = result;
|
|
9
9
|
}
|
|
@@ -14,7 +14,7 @@ export class ManyToOneRecipe extends Recipe {
|
|
|
14
14
|
return [this.result];
|
|
15
15
|
}
|
|
16
16
|
replace(ingredientReplacer, resultReplacer) {
|
|
17
|
-
return new ManyToOneRecipe(this.
|
|
17
|
+
return new ManyToOneRecipe(this.ingredients.map(ingredientReplacer), resultReplacer(this.result));
|
|
18
18
|
}
|
|
19
19
|
serialize(context) {
|
|
20
20
|
return {
|
|
@@ -27,7 +27,7 @@ export class ManyToOneRecipeParser extends RecipeParser {
|
|
|
27
27
|
deserialize(definition, context) {
|
|
28
28
|
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
29
29
|
const result = context.results.create(definition.result);
|
|
30
|
-
return new ManyToOneRecipe(
|
|
30
|
+
return new ManyToOneRecipe(ingredients, result);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=manyToOne.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manyToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/manyToOne.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,eAAgB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"manyToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/manyToOne.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,eAAgB,SAAQ,MAAM;IAEpB;IACA;IAFrB,YACqB,WAAyB,EACzB,MAAc;QAEjC,KAAK,EAAE,CAAC;QAHW,gBAAW,GAAX,WAAW,CAAc;QACzB,WAAM,GAAN,MAAM,CAAQ;IAGnC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,eAAe,CACxB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACxC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,qBAEX,SAAQ,YAA0C;IAClD,WAAW,CACT,UAAuB,EACvB,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,eAAe,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -9,7 +9,7 @@ export type OneToOneRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
9
9
|
export declare class OneToOneRecipe extends Recipe {
|
|
10
10
|
protected readonly ingredient: Ingredient;
|
|
11
11
|
protected readonly result: Result;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(ingredient: Ingredient, result: Result);
|
|
13
13
|
getIngredients(): Ingredient[];
|
|
14
14
|
getResults(): Result[];
|
|
15
15
|
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): OneToOneRecipe;
|
|
@@ -2,8 +2,8 @@ import RecipeParser, { Recipe, } from "./index.js";
|
|
|
2
2
|
export class OneToOneRecipe extends Recipe {
|
|
3
3
|
ingredient;
|
|
4
4
|
result;
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
5
|
+
constructor(ingredient, result) {
|
|
6
|
+
super();
|
|
7
7
|
this.ingredient = ingredient;
|
|
8
8
|
this.result = result;
|
|
9
9
|
}
|
|
@@ -14,7 +14,7 @@ export class OneToOneRecipe extends Recipe {
|
|
|
14
14
|
return [this.result];
|
|
15
15
|
}
|
|
16
16
|
replace(ingredientReplacer, resultReplacer) {
|
|
17
|
-
return new OneToOneRecipe(
|
|
17
|
+
return new OneToOneRecipe(ingredientReplacer(this.ingredient), resultReplacer(this.result));
|
|
18
18
|
}
|
|
19
19
|
serialize(context) {
|
|
20
20
|
return {
|
|
@@ -27,7 +27,7 @@ export class OneToOneRecipeParser extends RecipeParser {
|
|
|
27
27
|
deserialize(definition, context) {
|
|
28
28
|
const ingredient = context.ingredients.create(definition.ingredient);
|
|
29
29
|
const result = context.results.create(definition.result);
|
|
30
|
-
return new OneToOneRecipe(
|
|
30
|
+
return new OneToOneRecipe(ingredient, result);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=oneToOne.js.map
|