-
Notifications
You must be signed in to change notification settings - Fork 0
/
Overbaked.hpp
109 lines (105 loc) · 3.64 KB
/
Overbaked.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
/**************************************************************************
* Program Name:Overbaked.hpp
* Name: Manda Jensen
* Date: 08 JUN 2019
* Description: This file contains the definition of the class Overbaked.
* Variables:
* Space* kitchen - pointer to the top left most corner of the
* kitchen
* Space* player - points to the player's location in the kitchen,
* the location always starts in the same place within
* the kitchen
* int currMove - current move the player is on
* vector<ingredients> basket - ingredients vector containing all
* of the ingredients the player currently has, limited
* to three ingredients at any given time in the Space
* class
* bool browniesComplete - flag indicating if the baked brownies
* have been delivered to the window yet, false if no,
* true if yes
*
* Functions:
* Overbaked() - default constructor
* Parameters: none
* Return Type: n/a
* Purpose: initializes the kitchen space pointer to a
* pointer with the below space arrangement, initializes
* the player pointer to point to the same space as the
* kitchen, set currMove to 1, set the ingredient vector
* list to an empty list, set the browniesComplete flags
* to false
* kitchen arrangement:
* ref pantry bowl mixer
* oven dish window trash
* ~Overbaked() - default destructor
* Parameters: n/a
* Return Type: n/a
* Purpose: safely frees the memory used for the
* dynamically allocated Space objects that are defined
* in the default constructor
* playGame()
* Parameters: none
* Return Type: void
* Purpose: Loops playRound() until the complete flag is
* true or the currStep is > 25
* playRound()
* Parameters: none
* Return Type: void
* Purpose: goes through the motions of one round of the
* game, prints the header for the round, calls printKitchen
* and printBasket, calls the move function with the moveMenu
* as the argument, calls the play function of the Square
* that the player is on and pass basket as the argument
* move()
* Parameters: int
* Return Type: void
* Purpose: use the integer passed as an argument to move
* the player Space pointer to the space in the direction
* as requested in the argument, if the direction of the
* move is not possible as there is no space in that
* direction (check using the empty_ function of the space
* for the direction), print a message to the user saying
* they cannot move, after the move or non-move, call
* printKitchen
* moveMenu()
* Parameters: none
* Return Type: int
* Purpose: print the menu to the user of which direction
* to move in, there are five options - up, down, left,
* right and no move, returns the integer corresponding
* with the choice of the user
* printKitchen()
* Parameters: none
* Return Type: void
* Purpose: calls the printType() for each space in the
* kitchen and prints the arrangement of the kitchen to the
* screen
* printBasket()
* Parmaeters: none
* Return Type: void
* Purpose: prints all ingredients in the basket and how
* much space is left in the basket
**************************************************************************/
#ifndef OVERBAKED_H
#define OVERBAKED_H
#include "Space.hpp"
#include "ingredients.hpp"
#include <vector>
class Overbaked
{ private:
Space* kitchen;
Space* player;
int currMove;
std::vector<ingredients> basket;
bool browniesComplete;
public:
Overbaked();
~Overbaked();
void playGame();
void playRound();
void move(int direction);
int moveMenu();
void printKitchen();
void printBasket();
};
#endif //OVERBAKED_H