-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.hpp
78 lines (71 loc) · 2.69 KB
/
Game.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
/******************************************************************************
** Game Class Declaration File
** Author: Lauren "Ren" Demeis-Ortiz
** Date: 12/6/19
** Description: This is the class declaration file for the Game Class.
******************************************************************************/
#ifndef GAME_HPP
#define GAME_HPP
#include "Menu.hpp"
#include "Space.hpp"
#include "Animal.hpp"
#include "Cat.hpp"
#include "Dog.hpp"
#include "BreakSpace.hpp"
#include "OpenSpace.hpp"
#include "UseSpace.hpp"
#include <string>
enum GameState{PLAYING, NOCHAOS, CAUGHT, VICTORY, QUIT};
// Game Class Declarations
class Game
{
private:
Menu startMenu;
Space* currRoom;
BreakSpace* foyer;
BreakSpace* livingDiningRoom;
UseSpace* kitchen;
UseSpace* bathroom;
OpenSpace* bedroom;
OpenSpace* garden;
Dog* dog;
Cat* cat;
GameState status;
char userInput;
char actionKey;
int time;
int chaosFactor;
bool actionKeyMode;
std::string instructions;
public:
Game(); // Constructor
~Game(); // Destructor
int runStartMenu(); // Runs play/quit menu. Returns user choice.
void runInstructions(); // Runs instruction process
void runGame(); // Runs from instructions to game over
void runGameOver(); // Runs game over sequence
void buildHouse(); // Links roooms
void linkFoyer();
void linkLivingDiningRoom();
void linkKitchen();
void linkBathroom();
void linkBedroom();
void linkGarden();
void printChaos(); // Prints Chaos points
void printCurrRoomName(); // Prints current room's name
void printTimer(); // Calculates minutes and seconds and prints timer
void printBuffer(); // Prints extra lines as a buffer on the screen
void printContainers(); // Prints high space and mouth contents
void updateScreen(); // Prints play screen
void runGamePlay(); // Runs loop for gameplay for room
void doAction(); // Does action for action key mode
void updateStatus(); // Returns true if game over conditions are met
void checkNext(); // If onNext changes current room to previous room
void checkPrev(); // If onPrev changes current room to previous room
bool onPrev(); // Returns true if cat is at door to previous room
bool onNext(); // Returns true if cat is at door to next room
bool validInput(); // Returns true if input is valid
bool validDirection(); // Returns true if input is a valid direction
bool validAction(); // Returns true if input is a valid action
};
#endif