-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathProgram.cs
More file actions
25 lines (19 loc) · 860 Bytes
/
Copy pathProgram.cs
File metadata and controls
25 lines (19 loc) · 860 Bytes
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
using CompositePattern.MenuComponent;
IMenuComponent pancakeHouseMenu = new Menu("PANCAKE HOUSE MENU", "Breakfast");
IMenuComponent dinerMenu = new Menu("DINER MENU", "Lunch");
IMenuComponent cafeMenu = new Menu("CAFE MENU", "Dinner");
IMenuComponent dessertMenu = new Menu("DESSERT MENU", "Dessert of course!");
IMenuComponent allMenus = new Menu("ALL MENUS", "All menus combined.");
allMenus.Add(pancakeHouseMenu);
allMenus.Add(dinerMenu);
allMenus.Add(cafeMenu);
dinerMenu.Add(new MenuItem("Pasta",
"Spaghetti with Marinara Sauce, and a slice of sourdough bread",
true, 3.89m));
dinerMenu.Add(dessertMenu);
dessertMenu.Add(new MenuItem("Apple Pie",
"Apple pie with a flaky crust, topped with vanilla ice cream",
true, 1.59m));
var waitress = new CompositePattern.Waitress.Waitress(allMenus);
waitress.PrintMenu();
Console.ReadKey();