-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
27 lines (19 loc) · 1.08 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using ParserCookingRecipe.ingredient.basic;
using ParserCookingRecipe.interpreter;
using ParserCookingRecipe.operation.complex;
using ParserCookingRecipe.operation.simple;
CookingOrder TakeYellowOrder = new SimpleOperationCookingOrder(new SimpleOperation("PrendreJaune"), new IngredientCookingOrder(new BasicIngredient("Oeuf")));
CookingRecipeOrder context = new CookingRecipeOrder();
CookingOrder MixOrder = new NaryOperationCookingOrder(new NaryOperation("Mélanger"), [
TakeYellowOrder,
new IngredientCookingOrder(new BasicIngredient("Moutarde")),
new IngredientCookingOrder(new BasicIngredient("Vinaigre")),
]);
CookingOrder AddOrder = new NaryOperationCookingOrder(new NaryOperation("Ajouter"), [
MixOrder,
new IngredientCookingOrder(new BasicIngredient("Huile")),
]);
CookingOrder MayonnaiseRecipe = new SimpleOperationCookingOrder(new SimpleOperation("Touiller"), AddOrder);
CookingRecipeOrder MayonnaiseOrder = new CookingRecipeOrder();
MayonnaiseRecipe.Interprete(MayonnaiseOrder);
Console.WriteLine(MayonnaiseOrder.Ingredient.Name);