@adeficior/data-modifier 1.0.0-rc.13 → 1.0.0-rc.15
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 +3 -3
- package/dist/parser/recipe/adAstra/conversion.js +5 -5
- package/dist/parser/recipe/adAstra/conversion.js.map +1 -1
- package/dist/parser/recipe/adAstra/inputOutput.d.ts +4 -4
- package/dist/parser/recipe/adAstra/inputOutput.js +5 -5
- package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -1
- package/dist/parser/recipe/adAstra/spaceStation.d.ts +3 -3
- package/dist/parser/recipe/adAstra/spaceStation.js +5 -5
- package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -1
- package/dist/parser/recipe/botania/apothecary.d.ts +3 -3
- package/dist/parser/recipe/botania/apothecary.js +5 -5
- 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 +3 -3
- package/dist/parser/recipe/botania/brew.js +5 -5
- 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 +5 -7
- package/dist/parser/recipe/botania/gogWrapper.js +5 -5
- package/dist/parser/recipe/botania/gogWrapper.js.map +1 -1
- package/dist/parser/recipe/botania/manaInfusion.d.ts +3 -3
- package/dist/parser/recipe/botania/manaInfusion.js +5 -5
- package/dist/parser/recipe/botania/manaInfusion.js.map +1 -1
- package/dist/parser/recipe/botania/nbtWrapper.d.ts +5 -7
- package/dist/parser/recipe/botania/nbtWrapper.js +5 -5
- 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 +3 -3
- package/dist/parser/recipe/create/assembly.js +5 -5
- package/dist/parser/recipe/create/assembly.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cooking.d.ts +3 -3
- package/dist/parser/recipe/farmersdelight/cooking.js +5 -5
- package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cutting.d.ts +3 -4
- package/dist/parser/recipe/farmersdelight/cutting.js +5 -5
- package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -1
- package/dist/parser/recipe/forge/conditional.d.ts +6 -8
- package/dist/parser/recipe/forge/conditional.js +7 -7
- package/dist/parser/recipe/forge/conditional.js.map +1 -1
- package/dist/parser/recipe/index.d.ts +26 -8
- package/dist/parser/recipe/index.js +38 -6
- package/dist/parser/recipe/index.js.map +1 -1
- package/dist/parser/recipe/manyToMany.d.ts +3 -3
- package/dist/parser/recipe/manyToMany.js +5 -5
- package/dist/parser/recipe/manyToMany.js.map +1 -1
- package/dist/parser/recipe/manyToOne.d.ts +3 -3
- package/dist/parser/recipe/manyToOne.js +5 -5
- package/dist/parser/recipe/manyToOne.js.map +1 -1
- package/dist/parser/recipe/oneToOne.d.ts +3 -3
- package/dist/parser/recipe/oneToOne.js +5 -5
- package/dist/parser/recipe/oneToOne.js.map +1 -1
- package/dist/parser/recipe/roots/component.d.ts +3 -3
- package/dist/parser/recipe/roots/component.js +5 -5
- package/dist/parser/recipe/roots/component.js.map +1 -1
- package/dist/parser/recipe/roots/ritual.d.ts +3 -4
- package/dist/parser/recipe/roots/ritual.js +5 -5
- package/dist/parser/recipe/roots/ritual.js.map +1 -1
- package/dist/parser/recipe/thermal/catalyst.d.ts +3 -3
- package/dist/parser/recipe/thermal/catalyst.js +5 -5
- package/dist/parser/recipe/thermal/catalyst.js.map +1 -1
- package/dist/parser/recipe/thermal/fuel.d.ts +3 -3
- package/dist/parser/recipe/thermal/fuel.js +5 -5
- package/dist/parser/recipe/thermal/fuel.js.map +1 -1
- package/dist/parser/recipe/thermal/index.d.ts +3 -3
- package/dist/parser/recipe/thermal/index.js +5 -5
- package/dist/parser/recipe/thermal/index.js.map +1 -1
- package/dist/parser/recipe/thermal/treeExtraction.d.ts +3 -3
- package/dist/parser/recipe/thermal/treeExtraction.js +5 -5
- package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -1
- package/dist/parser/recipe/vanilla/shaped.d.ts +4 -5
- package/dist/parser/recipe/vanilla/shaped.js +5 -5
- package/dist/parser/recipe/vanilla/shaped.js.map +1 -1
- package/dist/parser/recipe/vanilla/smelting.d.ts +3 -3
- package/dist/parser/recipe/vanilla/smelting.js +5 -5
- package/dist/parser/recipe/vanilla/smelting.js.map +1 -1
- package/dist/parser/recipe/vanilla/smithing.d.ts +3 -3
- package/dist/parser/recipe/vanilla/smithing.js +5 -5
- package/dist/parser/recipe/vanilla/smithing.js.map +1 -1
- package/dist/parser/recipe/vanilla/stonecutting.d.ts +3 -3
- package/dist/parser/recipe/vanilla/stonecutting.js +5 -5
- package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,20 +9,51 @@ 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(modifier) {
|
|
35
|
+
const modified = this.recipe.replace(modifier);
|
|
36
|
+
return new RecipeHolder(this.definition, modified);
|
|
16
37
|
}
|
|
17
38
|
replaceIngredient(replace) {
|
|
18
|
-
return this.replace(
|
|
39
|
+
return this.replace({
|
|
40
|
+
ingredient: replace,
|
|
41
|
+
result: keep(),
|
|
42
|
+
});
|
|
19
43
|
}
|
|
20
44
|
replaceResult(replace) {
|
|
21
|
-
return this.replace(
|
|
45
|
+
return this.replace({
|
|
46
|
+
ingredient: keep(),
|
|
47
|
+
result: replace,
|
|
48
|
+
});
|
|
22
49
|
}
|
|
23
50
|
getTypes() {
|
|
24
|
-
return [this.
|
|
51
|
+
return [this.type, ...this.recipe.additionalTypes()];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export class Recipe {
|
|
55
|
+
additionalTypes() {
|
|
56
|
+
return [];
|
|
25
57
|
}
|
|
26
58
|
}
|
|
27
59
|
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":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AAM,EAAE,IAAI,EAAE;SACf,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CAAC,OAAyB;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,UAAU,EAAE,IAAI,EAAE;YAClB,MAAM,EAAE,OAAO;SAChB,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC;IACvD,CAAC;CACF;AAED,MAAM,OAAgB,MAAM;IAO1B,eAAe;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;CAGF;AAcD,MAAM,CAAC,OAAO,OAAgB,YAAY;CAQzC"}
|
|
@@ -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 RecipeParser, { Recipe, type
|
|
4
|
+
import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "./index.js";
|
|
5
5
|
export type ManyToManyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
6
6
|
ingredients: unknown[];
|
|
7
7
|
results: unknown[];
|
|
@@ -9,10 +9,10 @@ export type ManyToManyRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
9
9
|
export declare class ManyToManyRecipe 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
|
-
replace(
|
|
15
|
+
replace(modifier: RecipeModifier): ManyToManyRecipe;
|
|
16
16
|
serialize(context: RecipeParseContext): Partial<ManyToManyRecipeDefinition>;
|
|
17
17
|
}
|
|
18
18
|
export declare class ManyToManyRecipeParser<TDefinition extends ManyToManyRecipeDefinition> extends RecipeParser<TDefinition, 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
|
}
|
|
@@ -13,8 +13,8 @@ export class ManyToManyRecipe extends Recipe {
|
|
|
13
13
|
getResults() {
|
|
14
14
|
return this.results;
|
|
15
15
|
}
|
|
16
|
-
replace(
|
|
17
|
-
return new ManyToManyRecipe(this.
|
|
16
|
+
replace(modifier) {
|
|
17
|
+
return new ManyToManyRecipe(this.ingredients.map(modifier.ingredient), this.results.map(modifier.result));
|
|
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,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,gBAAiB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/parser/recipe/manyToMany.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,gBAAiB,SAAQ,MAAM;IAErB;IACA;IAFrB,YACqB,WAAyB,EACzB,OAAiB;QAEpC,KAAK,EAAE,CAAC;QAHW,gBAAW,GAAX,WAAW,CAAc;QACzB,YAAO,GAAP,OAAO,CAAU;IAGtC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAClC,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC;YACpD,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,sBAEX,SAAQ,YAA2C;IACnD,WAAW,CACT,UAAuB,EACvB,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC/D,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,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 RecipeParser, { Recipe, type
|
|
4
|
+
import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "./index.js";
|
|
5
5
|
export type ManyToOneRecipeDefinition = RecipeDefinition & Readonly<{
|
|
6
6
|
ingredients: unknown[];
|
|
7
7
|
result: unknown;
|
|
@@ -9,10 +9,10 @@ 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
|
-
replace(
|
|
15
|
+
replace(modifier: RecipeModifier): ManyToOneRecipe;
|
|
16
16
|
serialize(context: RecipeParseContext): Partial<ManyToOneRecipeDefinition>;
|
|
17
17
|
}
|
|
18
18
|
export declare class ManyToOneRecipeParser<TDefinition extends ManyToOneRecipeDefinition> extends RecipeParser<TDefinition, 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
|
}
|
|
@@ -13,8 +13,8 @@ export class ManyToOneRecipe extends Recipe {
|
|
|
13
13
|
getResults() {
|
|
14
14
|
return [this.result];
|
|
15
15
|
}
|
|
16
|
-
replace(
|
|
17
|
-
return new ManyToOneRecipe(this.
|
|
16
|
+
replace(modifier) {
|
|
17
|
+
return new ManyToOneRecipe(this.ingredients.map(modifier.ingredient), modifier.result(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,CAAC,QAAwB;QACvC,OAAO,IAAI,eAAe,CACxB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAC7B,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"}
|
|
@@ -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 RecipeParser, { Recipe, type
|
|
4
|
+
import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "./index.js";
|
|
5
5
|
export type OneToOneRecipeDefinition = RecipeDefinition & Readonly<{
|
|
6
6
|
ingredient: unknown;
|
|
7
7
|
result: unknown;
|
|
@@ -9,10 +9,10 @@ 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
|
-
replace(
|
|
15
|
+
replace(modifier: RecipeModifier): OneToOneRecipe;
|
|
16
16
|
serialize(context: RecipeParseContext): Partial<OneToOneRecipeDefinition>;
|
|
17
17
|
}
|
|
18
18
|
export declare class OneToOneRecipeParser<TDefinition extends OneToOneRecipeDefinition> extends RecipeParser<TDefinition, 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
|
}
|
|
@@ -13,8 +13,8 @@ export class OneToOneRecipe extends Recipe {
|
|
|
13
13
|
getResults() {
|
|
14
14
|
return [this.result];
|
|
15
15
|
}
|
|
16
|
-
replace(
|
|
17
|
-
return new OneToOneRecipe(
|
|
16
|
+
replace(modifier) {
|
|
17
|
+
return new OneToOneRecipe(modifier.ingredient(this.ingredient), modifier.result(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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oneToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/oneToOne.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,cAAe,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"oneToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/oneToOne.ts"],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{ RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { RecipeModifier, RecipeParseContext } from "../index.js";
|
|
4
4
|
import RecipeParser, { Recipe } from "../index.js";
|
|
5
5
|
export type RootComponentRecipeDefinition = RecipeDefinition & Readonly<{
|
|
6
6
|
effect: string;
|
|
@@ -8,10 +8,10 @@ export type RootComponentRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
8
8
|
}>;
|
|
9
9
|
export declare class RootComponentRecipe extends Recipe {
|
|
10
10
|
private readonly ingredients;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(ingredients: Ingredient[]);
|
|
12
12
|
getIngredients(): Ingredient[];
|
|
13
13
|
getResults(): never[];
|
|
14
|
-
replace(
|
|
14
|
+
replace(modifier: RecipeModifier): RootComponentRecipe;
|
|
15
15
|
serialize(context: RecipeParseContext): Partial<RootComponentRecipeDefinition>;
|
|
16
16
|
}
|
|
17
17
|
export declare class RootComponentRecipeParser extends RecipeParser<RootComponentRecipeDefinition, RootComponentRecipe> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class RootComponentRecipe extends Recipe {
|
|
3
3
|
ingredients;
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(ingredients) {
|
|
5
|
+
super();
|
|
6
6
|
this.ingredients = ingredients;
|
|
7
7
|
}
|
|
8
8
|
getIngredients() {
|
|
@@ -11,8 +11,8 @@ export class RootComponentRecipe extends Recipe {
|
|
|
11
11
|
getResults() {
|
|
12
12
|
return [];
|
|
13
13
|
}
|
|
14
|
-
replace(
|
|
15
|
-
return new RootComponentRecipe(this.
|
|
14
|
+
replace(modifier) {
|
|
15
|
+
return new RootComponentRecipe(this.ingredients.map(modifier.ingredient));
|
|
16
16
|
}
|
|
17
17
|
serialize(context) {
|
|
18
18
|
return {
|
|
@@ -23,7 +23,7 @@ export class RootComponentRecipe extends Recipe {
|
|
|
23
23
|
export class RootComponentRecipeParser extends RecipeParser {
|
|
24
24
|
deserialize(definition, context) {
|
|
25
25
|
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
26
|
-
return new RootComponentRecipe(
|
|
26
|
+
return new RootComponentRecipe(ingredients);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/component.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,mBAAoB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/component.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,mBAAoB,SAAQ,MAAM;IAChB;IAA7B,YAA6B,WAAyB;QACpD,KAAK,EAAE,CAAC;QADmB,gBAAW,GAAX,WAAW,CAAc;IAEtD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,YAG9C;IACC,WAAW,CACT,UAAyC,EACzC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,OAAO,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
2
|
import type { Result } from "../../../common/result/index.js";
|
|
3
|
-
import type {
|
|
4
|
-
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
3
|
+
import type { RecipeModifier, RecipeParseContext } from "../index.js";
|
|
5
4
|
import RecipeParser from "../index.js";
|
|
6
5
|
import { ManyToOneRecipe, type ManyToOneRecipeDefinition } from "../manyToOne.js";
|
|
7
6
|
export type RootRitualRecipeDefinition = ManyToOneRecipeDefinition & Readonly<{
|
|
@@ -12,9 +11,9 @@ export type RootRitualRecipeDefinition = ManyToOneRecipeDefinition & Readonly<{
|
|
|
12
11
|
}>;
|
|
13
12
|
export declare class RootRitualRecipe extends ManyToOneRecipe {
|
|
14
13
|
private readonly incenses;
|
|
15
|
-
constructor(
|
|
14
|
+
constructor(ingredients: Ingredient[], result: Result, incenses?: Ingredient[]);
|
|
16
15
|
getIngredients(): Ingredient[];
|
|
17
|
-
replace(
|
|
16
|
+
replace(modifier: RecipeModifier): RootRitualRecipe;
|
|
18
17
|
}
|
|
19
18
|
export declare class RootRitualRecipeParser extends RecipeParser<RootRitualRecipeDefinition, RootRitualRecipe> {
|
|
20
19
|
deserialize(definition: RootRitualRecipeDefinition, context: RecipeParseContext): RootRitualRecipe;
|
|
@@ -2,15 +2,15 @@ import RecipeParser from "../index.js";
|
|
|
2
2
|
import { ManyToOneRecipe, } from "../manyToOne.js";
|
|
3
3
|
export class RootRitualRecipe extends ManyToOneRecipe {
|
|
4
4
|
incenses;
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
5
|
+
constructor(ingredients, result, incenses = []) {
|
|
6
|
+
super(ingredients, result);
|
|
7
7
|
this.incenses = incenses;
|
|
8
8
|
}
|
|
9
9
|
getIngredients() {
|
|
10
10
|
return [...super.getIngredients(), ...this.incenses];
|
|
11
11
|
}
|
|
12
|
-
replace(
|
|
13
|
-
return new RootRitualRecipe(this.
|
|
12
|
+
replace(modifier) {
|
|
13
|
+
return new RootRitualRecipe(this.incenses.map(modifier.ingredient), modifier.result(this.result), this.incenses.map(modifier.ingredient));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
export class RootRitualRecipeParser extends RecipeParser {
|
|
@@ -19,7 +19,7 @@ export class RootRitualRecipeParser extends RecipeParser {
|
|
|
19
19
|
const result = context.results.create(definition.result);
|
|
20
20
|
const incenses = definition.incenses &&
|
|
21
21
|
context.ingredients.createList(definition.incenses);
|
|
22
|
-
return new RootRitualRecipe(
|
|
22
|
+
return new RootRitualRecipe(ingredients, result, incenses);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=ritual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ritual.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/ritual.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ritual.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/ritual.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AAUzB,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAIhC;IAHnB,YACE,WAAyB,EACzB,MAAc,EACG,WAAyB,EAAE;QAE5C,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFV,aAAQ,GAAR,QAAQ,CAAmB;IAG9C,CAAC;IAEQ,cAAc;QACrB,OAAO,CAAC,GAAG,KAAK,CAAC,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EACtC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CACvC,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,QAAQ,GACZ,UAAU,CAAC,QAAQ;YACnB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtD,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
2
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { RecipeModifier, RecipeParseContext } from "../index.js";
|
|
4
4
|
import RecipeParser, { Recipe } from "../index.js";
|
|
5
5
|
export type ThermalCatalystRecipeDefinition = RecipeDefinition & Readonly<{
|
|
6
6
|
ingredient: unknown;
|
|
@@ -12,10 +12,10 @@ export type ThermalCatalystRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
12
12
|
}>;
|
|
13
13
|
export declare class ThermalCatalystRecipe extends Recipe {
|
|
14
14
|
private readonly ingredient;
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(ingredient: Ingredient);
|
|
16
16
|
getIngredients(): Ingredient[];
|
|
17
17
|
getResults(): never[];
|
|
18
|
-
replace(
|
|
18
|
+
replace(modifier: RecipeModifier): ThermalCatalystRecipe;
|
|
19
19
|
serialize(context: RecipeParseContext): Partial<ThermalCatalystRecipeDefinition>;
|
|
20
20
|
}
|
|
21
21
|
export declare class ThermalCatalystRecipeParser extends RecipeParser<ThermalCatalystRecipeDefinition, ThermalCatalystRecipe> {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class ThermalCatalystRecipe extends Recipe {
|
|
3
3
|
ingredient;
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
4
|
+
constructor(ingredient) {
|
|
5
|
+
super();
|
|
6
6
|
this.ingredient = ingredient;
|
|
7
7
|
}
|
|
8
8
|
getIngredients() {
|
|
@@ -11,8 +11,8 @@ export class ThermalCatalystRecipe extends Recipe {
|
|
|
11
11
|
getResults() {
|
|
12
12
|
return [];
|
|
13
13
|
}
|
|
14
|
-
replace(
|
|
15
|
-
return new ThermalCatalystRecipe(
|
|
14
|
+
replace(modifier) {
|
|
15
|
+
return new ThermalCatalystRecipe(modifier.ingredient(this.ingredient));
|
|
16
16
|
}
|
|
17
17
|
serialize(context) {
|
|
18
18
|
return {
|
|
@@ -23,7 +23,7 @@ export class ThermalCatalystRecipe extends Recipe {
|
|
|
23
23
|
export class ThermalCatalystRecipeParser extends RecipeParser {
|
|
24
24
|
deserialize(definition, context) {
|
|
25
25
|
const ingredient = context.ingredients.create(definition.ingredient);
|
|
26
|
-
return new ThermalCatalystRecipe(
|
|
26
|
+
return new ThermalCatalystRecipe(ingredient);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=catalyst.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalyst.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/catalyst.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,qBAAsB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"catalyst.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/catalyst.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,qBAAsB,SAAQ,MAAM;IAClB;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACzE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,YAGhD;IACC,WAAW,CACT,UAA2C,EAC3C,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
2
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { RecipeModifier, RecipeParseContext } from "../index.js";
|
|
4
4
|
import RecipeParser, { Recipe } from "../index.js";
|
|
5
5
|
export type ThermalFuelRecipeDefinition = RecipeDefinition & Readonly<{
|
|
6
6
|
energy: number;
|
|
@@ -8,10 +8,10 @@ export type ThermalFuelRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
8
8
|
}>;
|
|
9
9
|
export declare class ThermalFuelRecipe extends Recipe {
|
|
10
10
|
private readonly ingredient;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(ingredient: Ingredient);
|
|
12
12
|
getIngredients(): Ingredient[];
|
|
13
13
|
getResults(): never[];
|
|
14
|
-
replace(
|
|
14
|
+
replace(modifier: RecipeModifier): ThermalFuelRecipe;
|
|
15
15
|
serialize(context: RecipeParseContext): Partial<ThermalFuelRecipeDefinition>;
|
|
16
16
|
}
|
|
17
17
|
export declare class ThermalFuelRecipeParser extends RecipeParser<ThermalFuelRecipeDefinition, ThermalFuelRecipe> {
|
|
@@ -2,8 +2,8 @@ import RecipeParser, { Recipe } from "../index.js";
|
|
|
2
2
|
// TODO could be same as catalyst
|
|
3
3
|
export class ThermalFuelRecipe extends Recipe {
|
|
4
4
|
ingredient;
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
5
|
+
constructor(ingredient) {
|
|
6
|
+
super();
|
|
7
7
|
this.ingredient = ingredient;
|
|
8
8
|
}
|
|
9
9
|
getIngredients() {
|
|
@@ -12,8 +12,8 @@ export class ThermalFuelRecipe extends Recipe {
|
|
|
12
12
|
getResults() {
|
|
13
13
|
return [];
|
|
14
14
|
}
|
|
15
|
-
replace(
|
|
16
|
-
return new ThermalFuelRecipe(
|
|
15
|
+
replace(modifier) {
|
|
16
|
+
return new ThermalFuelRecipe(modifier.ingredient(this.ingredient));
|
|
17
17
|
}
|
|
18
18
|
serialize(context) {
|
|
19
19
|
return {
|
|
@@ -24,7 +24,7 @@ export class ThermalFuelRecipe extends Recipe {
|
|
|
24
24
|
export class ThermalFuelRecipeParser extends RecipeParser {
|
|
25
25
|
deserialize(definition, context) {
|
|
26
26
|
const ingredient = context.ingredients.create(definition.ingredient);
|
|
27
|
-
return new ThermalFuelRecipe(
|
|
27
|
+
return new ThermalFuelRecipe(ingredient);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=fuel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fuel.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/fuel.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,iCAAiC;AACjC,MAAM,OAAO,iBAAkB,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"fuel.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/fuel.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,iCAAiC;AACjC,MAAM,OAAO,iBAAkB,SAAQ,MAAM;IACd;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,YAG5C;IACC,WAAW,CACT,UAAuC,EACvC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -1,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 {
|
|
4
|
+
import type { RecipeModifier, RecipeParseContext } from "../index.js";
|
|
5
5
|
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type ThermalRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
7
|
ingredient?: unknown;
|
|
@@ -13,10 +13,10 @@ export type ThermalRecipeDefinition = RecipeDefinition & Readonly<{
|
|
|
13
13
|
export declare class ThermalRecipe extends Recipe {
|
|
14
14
|
private readonly ingredients;
|
|
15
15
|
private readonly results;
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(ingredients: Ingredient[], results: Result[]);
|
|
17
17
|
getIngredients(): Ingredient[];
|
|
18
18
|
getResults(): Result[];
|
|
19
|
-
replace(
|
|
19
|
+
replace(modifier: RecipeModifier): ThermalRecipe;
|
|
20
20
|
serialize(context: RecipeParseContext): Partial<ThermalRecipeDefinition>;
|
|
21
21
|
}
|
|
22
22
|
export declare class ThermalRecipeParser extends RecipeParser<ThermalRecipeDefinition, ThermalRecipe> {
|
|
@@ -3,8 +3,8 @@ import RecipeParser, { Recipe } from "../index.js";
|
|
|
3
3
|
export class ThermalRecipe extends Recipe {
|
|
4
4
|
ingredients;
|
|
5
5
|
results;
|
|
6
|
-
constructor(
|
|
7
|
-
super(
|
|
6
|
+
constructor(ingredients, results) {
|
|
7
|
+
super();
|
|
8
8
|
this.ingredients = ingredients;
|
|
9
9
|
this.results = results;
|
|
10
10
|
}
|
|
@@ -14,8 +14,8 @@ export class ThermalRecipe extends Recipe {
|
|
|
14
14
|
getResults() {
|
|
15
15
|
return this.results;
|
|
16
16
|
}
|
|
17
|
-
replace(
|
|
18
|
-
return new ThermalRecipe(this.
|
|
17
|
+
replace(modifier) {
|
|
18
|
+
return new ThermalRecipe(this.ingredients.map(modifier.ingredient), this.results.map(modifier.result));
|
|
19
19
|
}
|
|
20
20
|
serialize(context) {
|
|
21
21
|
const serialized = {
|
|
@@ -41,7 +41,7 @@ export class ThermalRecipeParser extends RecipeParser {
|
|
|
41
41
|
const results = Array.isArray(definition.result)
|
|
42
42
|
? context.results.createList(definition.result)
|
|
43
43
|
: [context.results.create(definition.result)];
|
|
44
|
-
return new ThermalRecipe(
|
|
44
|
+
return new ThermalRecipe(ingredients, results);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWnD,MAAM,OAAO,aAAc,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWnD,MAAM,OAAO,aAAc,SAAQ,MAAM;IAEpB;IACA;IAFnB,YACmB,WAAyB,EACzB,OAAiB;QAElC,KAAK,EAAE,CAAC;QAHS,gBAAW,GAAX,WAAW,CAAc;QACzB,YAAO,GAAP,OAAO,CAAU;IAGpC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,aAAa,CACtB,IAAI,CAAC,WAAW,CAA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AC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAEhD,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF"}
|
|
@@ -2,7 +2,7 @@ import type { BlockId } from "@adeficior/data-modifier/generated";
|
|
|
2
2
|
import { type Ingredient } from "../../../common/ingredient/index.js";
|
|
3
3
|
import type { Result } from "../../../common/result/index.js";
|
|
4
4
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import RecipeParser, { Recipe, type
|
|
5
|
+
import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "../index.js";
|
|
6
6
|
export type TreeExtractionRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
7
|
leaves: BlockId;
|
|
8
8
|
trunk: BlockId;
|
|
@@ -12,10 +12,10 @@ export declare class TreeExtractionRecipe extends Recipe {
|
|
|
12
12
|
private readonly trunk;
|
|
13
13
|
private readonly leaves;
|
|
14
14
|
private readonly result;
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(trunk: Ingredient, leaves: Ingredient, result: Result);
|
|
16
16
|
getIngredients(): Ingredient[];
|
|
17
17
|
getResults(): Result[];
|
|
18
|
-
replace(
|
|
18
|
+
replace(modifier: RecipeModifier): TreeExtractionRecipe;
|
|
19
19
|
private serializeBlockIngredient;
|
|
20
20
|
serialize(context: RecipeParseContext): Partial<TreeExtractionRecipeDefinition>;
|
|
21
21
|
}
|
|
@@ -6,8 +6,8 @@ export class TreeExtractionRecipe extends Recipe {
|
|
|
6
6
|
trunk;
|
|
7
7
|
leaves;
|
|
8
8
|
result;
|
|
9
|
-
constructor(
|
|
10
|
-
super(
|
|
9
|
+
constructor(trunk, leaves, result) {
|
|
10
|
+
super();
|
|
11
11
|
this.trunk = trunk;
|
|
12
12
|
this.leaves = leaves;
|
|
13
13
|
this.result = result;
|
|
@@ -18,8 +18,8 @@ export class TreeExtractionRecipe extends Recipe {
|
|
|
18
18
|
getResults() {
|
|
19
19
|
return [this.result];
|
|
20
20
|
}
|
|
21
|
-
replace(
|
|
22
|
-
return new TreeExtractionRecipe(
|
|
21
|
+
replace(modifier) {
|
|
22
|
+
return new TreeExtractionRecipe(modifier.ingredient(this.trunk), modifier.ingredient(this.leaves), modifier.result(this.result));
|
|
23
23
|
}
|
|
24
24
|
serializeBlockIngredient(ingredient) {
|
|
25
25
|
if (ingredient instanceof BlockIngredient) {
|
|
@@ -40,7 +40,7 @@ export class TreeExtractionRecipeParser extends RecipeParser {
|
|
|
40
40
|
const trunk = context.ingredients.create(new BlockIngredient(definition.trunk));
|
|
41
41
|
const leaves = context.ingredients.create(new BlockIngredient(definition.leaves));
|
|
42
42
|
const result = context.results.create(definition.result);
|
|
43
|
-
return new TreeExtractionRecipe(
|
|
43
|
+
return new TreeExtractionRecipe(trunk, leaves, result);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
//# sourceMappingURL=treeExtraction.js.map
|