-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
38 lines (30 loc) · 1.14 KB
/
main.cpp
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
/* Justin Tromp
* Date: 01/21/2019
* Description: Runs zoo simulation by declaring zoo object. From zoo object, start menu is shown to user which allows
* user to start game or quit. If user selects to quit, main ends. If user selects to start, then zooSetup function is
* called and game will run from zooPlay in a loop until the user either goes bankrupt or selects to quit at end of turn
* from endMenu function.
*/
#include <iostream>
#include "Zoo.hpp"
int main() {
int menuSelection = 0;
Zoo ZooSimulation;
menuSelection = ZooSimulation.startMenu();
//If user selects to start simulation, start zoo setup
if (menuSelection == 1) {
//Setup zoo simulation
ZooSimulation.zooSetup();
}
bool userBankrupt = false;
//Loop while user selects to continue game and while user has not lost due to bankruptcy
while (menuSelection == 1 && !userBankrupt) {
//Start zoo simulation
userBankrupt = ZooSimulation.zooPlay();
if (userBankrupt == false) {
//Allow user to select from end menu
menuSelection = ZooSimulation.endMenu();
}
}
return 0;
}