-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClassTypes.hpp
125 lines (115 loc) · 2.94 KB
/
ClassTypes.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//
// ClassTypes.hpp
// comp252_final_project
//
// Created by Matthew Haddad on 10/31/19.
// Copyright © 2019 Matthew Haddad. All rights reserved.
//
#pragma once
#ifndef ClassTypes_hpp
#define ClassTypes_hpp
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
struct Ingredient{
Ingredient(){};
Ingredient(std::string n){ name = n;}
Ingredient(std::string n, int q, double c){name = n; quantity = q; cost = c;}
std::string name;
double quantity;
double cost;
};
struct MenuOption{
MenuOption(){};
MenuOption(std::string n){ name = n;}
MenuOption(std::string n, double un, double p, double ct){
name = n;
UnitCost = un;
Price = p;
CookTime = ct;
NumSold = 0;
TotalRevenue = 0;
}
MenuOption(std::string n, double un, double p, double ct, double ns, double tr){
name = n;
UnitCost = un;
Price = p;
CookTime = ct;
NumSold = ns;
TotalRevenue = tr;
}
void setAll(std::string n, double un, double p, double ct, double ns, double tr){
name = n;
UnitCost = un;
Price = p;
CookTime = ct;
NumSold = ns;
TotalRevenue = tr;
}
void setMain(std::string n, double un, double p, double ct){
name = n;
UnitCost = un;
Price = p;
CookTime = ct;
}
std::string name;
double UnitCost;
double Price;
double NumSold;
double TotalRevenue;
double CookTime;
std::vector<std::string> Ingredients;
std::vector<std::string> CookOptions;
friend std::istream& operator>>(std::istream& input, MenuOption& menOp);
};
std::istream& operator>>(std::istream& input, MenuOption& menOp){
input >> menOp.name;
input >> menOp.UnitCost;
input >> menOp.Price;
input >> menOp.NumSold;
input >> menOp.TotalRevenue;
input >> menOp.CookTime;
return input;
}
struct Discount{
Discount(){};
Discount(std::string n){name = n;}
Discount(std::string n, double da){name = n; DiscountAmount = da;}
std::string name;
std::vector<MenuOption> DiscountItems;
std::vector<int> DiscountTimes;
double DiscountAmount;
};
struct Menu{
Menu(){};
Menu(std::string n){name = n;}
std::string name;
std::vector<MenuOption> MenuOptions;
std::vector<Discount> MenuDiscounts;
friend std::istream& operator>>(std::istream& input, Menu tempMenu);
};
std::istream& operator>>(std::istream& input, Menu tempMenu){
input >> tempMenu.name;
return input;
}
struct Order{
std::vector<MenuOption> OrderOptions;
double orderPrice;
time_t orderBeginTime;
time_t orderEndTime;
bool orderInProgress;
bool orderComplete;
};
struct Waiter{
// Waiter(std::string n){ name = n;}
std::string name;
std::vector<Order> WaiterOrders;
};
struct Table{
int number;
Waiter waiter;
std::vector<Order> orders;
};
#endif /* ClassTypes_hpp */