-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
62 lines (57 loc) · 1.5 KB
/
Copy pathMenu.cpp
File metadata and controls
62 lines (57 loc) · 1.5 KB
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
/**
* @file Menu.cpp
* @author Justin
* @brief Class representing the menu to select options of the program from.
* @version 0.1
* @date 2018-11-28
*
* @copyright Copyright (c) 2018
*
*/
#include "Menu.h"
#include <unistd.h>
#include <iostream>
#include <string>
using namespace std;
/**
* @brief Construct a new Menu object with drinks created from the Drink Factory.
*
* @param factory Drink Factory containing all pre-programmed and saved drinks and liquids to be selected from the menu.
*/
Menu::Menu(DrinkFactory factory) {
//Drink drinkChoice;
drinkOptions = factory.getDrinks(); //Needs to be set to the list (vector) given by the factory
}
/**
* @brief Destroy the Menu object.
*
*/
Menu::~Menu() {
//Blank, nothing to destroy
}
/**
* @brief Method for pouring a drink from the selected choice from the menu.
*
* @param choice Integer representation of the choice chosen from the menu.
*/
void Menu::pourDrink(int choice){
//cout << "in pour drink" << choice << endl;
drinkChoice = drinkOptions[choice];
//cout << drinkChoice.getName() << endl;
drinkChoice.pour();
}
/**
* @brief Method for retrieving and returning a list of all available drinks.
*
* @return vector<Drink> Vector representation of a list of drinks available for creation.
*/
vector<Drink> Menu::getDrinks(){
return drinkOptions;
}
/**
* @brief Method for cleaning out the pipes of the machine using water to prevent cross drink contamination.
*
*/
void Menu::clean(){
//Blank for now
}