-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKitchen_System.hpp
73 lines (68 loc) · 2.79 KB
/
Kitchen_System.hpp
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
#pragma once
#ifndef Kitchen_System_h
#define Kitchen_System_h
#include "ClassTypes.h"
#include <time.h>
#include <iomanip>
//-------------------------------kitchenSystemFunctionDeclarations--------------------------------//
//display options
/*DONE*/void displayActiveTableOrders(Table t, int i);//displays active orders
/*DONE*/void displayActiveOrders(Order ord, int i);
/*DONE*/void displayTableProgress(Table t, int i);//displays elapsed time and progress of each order
/*DONE*/void displayOrderProgress(Order ord, int i);
/*DONE*/void displayMealPreferences(Menu m);//display preferences and optional choices of every meal
//waiter options
/*DONE*, in MainMenu.hpp///informs waiter with an order update of "in progress"*/
//initializes orderBeginTime with current time and sets orderInProgress to true
/*DONE*, informs waiter with an order update of "in progress" for a table*/
//initializes orderBeginTime with current time and sets orderInProgress to true
/**, inform waiter when order is complete*/
//-------------------------------kitchenSystemFunctionDeclarations--------------------------------//
int option = 0;
//-----------------------------kitchenSystemFunctionImplementationns------------------------------//
void displayActiveTableOrders(Table t, int i) {
for (Order o : t.orders) {
for (MenuOption m : o.OrderOptions) {
std::cout << std::setw(10) << i << std::setw(15) << m.name << std::endl;
}
}
}
void displayActiveOrders(Order ord, int i) {
for (MenuOption m : ord.OrderOptions) {
std::cout << " To-Go #" << i << std::setw(15) << m.name << std::endl;
}
}
void displayTableProgress(Table t, int i) {
for (Order o : t.orders) {
time_t begin = o.orderBeginTime;
for (MenuOption m : o.OrderOptions) {
time_t now = time(NULL);
time_t eTime = (now - begin);
time_t progress = (eTime / m.CookTime)*100;
std::cout << std::setw(9) << i << std::setw(21) << eTime << "s" << std::setw(11) << progress << "%" << std::setw(17) << m.name << std::endl;
}
}
}
void displayOrderProgress(Order ord, int i) {
int start = ord.orderBeginTime;
for (MenuOption m : ord.OrderOptions) {
time_t now = time(NULL);
time_t eTime = (now - start);
time_t progress = (eTime / m.CookTime)*100;
std::cout << " To-Go #" << i << std::setw(21) << eTime << "s" << std::setw(11) << progress << "%" << std::setw(17) << m.name << std::endl;
}
}
void displayMealPreferences(MenuOption m) {//display meal preferences, grab from vector<MenuOptions> OrderOptions
std::cout << std::setw(10) << m.name << std::setw(10);
for (std::string co : m.CookOptions) {
std::cout << co << ",";
}
std::cout << std::setw(38);
for (Ingredient i : m.Ingredients) {
std::cout << i.name << ",";
}
std::cout << std::endl;
}
//-----------------------------kitchenSystemFunctionImplementationns------------------------------//
#endif
#pragma once