-
Notifications
You must be signed in to change notification settings - Fork 1
/
GrillChef.cpp
77 lines (67 loc) · 1.85 KB
/
GrillChef.cpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "GrillChef.h"
Meal* GrillChef::createStarter()
{
return new BeefKebab;
}
Meal* GrillChef::createMain()
{
return new BeefBurger;
}
void GrillChef::addMeal(Meal* meal){
plate->addMeal(meal);
}
void GrillChef::receiveOrder(FoodItem* foodItem, int tableNumber, int custID, int numOfItems)
{
if(foodItem->getMealName() == "Beef Kebab")
{
cout << "Chopping up beef..." << endl;
sleep(1);
cout << "Spicing that baby..." << endl;
sleep(1);
cout << "Thrown on the pan..." << endl;
sleep(1);
cout << "Sizzle Sizzle!" << endl;
sleep(1);
cout <<"Assembling Kebab..."<< endl;
sleep(1);
cout << "Beef Kebab done!" << endl;
sleep(1);
this->addMeal(createStarter());
}
else if(foodItem->getMealName() == "Beef Burger")
{
cout << "Making patty" << endl;
sleep(1);
cout << "Spicing that baby..." << endl;
sleep(1);
cout << "Thrown on the pan..." << endl;
sleep(1);
cout << "Sizzle Sizzle!" << endl;
sleep(1);
if (foodItem->getWellDone()) {
cout << "Patty Well Done" << endl;
sleep(1);
}
if (!foodItem->getWellDone()) {
cout << "Patty Medium Rare" << endl;
sleep(1);
}
cout <<"Assembling Burger..."<< endl;
sleep(1);
if (foodItem->getGarnish()) {
cout << "Adding Lettuce, Tomato, And Gherkins" << endl;
sleep(1);
}
if (foodItem->getSauce()) {
cout << "Adding Special Sauce" << endl;
sleep(1);
}
cout << "Burger done!" << endl;
sleep(1);
this->addMeal(createMain());
}
if((int) plate->getMeals().size() == numOfItems)
{
mediator->notifyPlateReady(plate);
}
}