-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameModel.h
51 lines (46 loc) · 1.86 KB
/
GameModel.h
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
#include <string>
#include <iostream>
#include "fstream"
#include "Player.h"
#include "FactoryTable.h"
#include "BoxLid.h"
#include "TileBag.h"
class GameModel{
public:
//constructor new game
GameModel(std::string player1, std::string player2);
//overloaded constructor new game with seed
GameModel(std::string player1, std::string player2,int seed);
//overloaded constructor for loaded game
GameModel(Player* player1, Player* player2,FactoryTable* factories, TileBag* tileBag, BoxLid* boxLidLoad);
// destructor
~GameModel();
// start game play
void play();
// display game board
void displayGameboard(Player* player);
// save game data
void saveGame(std::string saveFileName);
// manage the game input commands
void commandParse(std::string command, Player* player);
// fill the factories from the tile bag
void fillFactories();
// move from factory to the pattern line
bool drawTileFromFactoryToPatternLine(int factory, Colour colour, int atPatternLine, Player* player);
// game play suppor function
bool playSupportFunction(Player* player, Player* otherPlayer,std::string command);
// check if the game end conditions are met
bool endGameConditionCheck();
private:
//player data saving support function
void savePlayerData(Player* player, std::ofstream& saveFile);
FactoryTable* Factories;
Player* player1;
Player* player2;
BoxLid* boxLid;
TileBag* tileBag;
bool roundComplete = false; // This two booleans shouldn't be required here. and this really
bool quit = false; // isn't optimal, but was a quick fix to be accessible from multiple methods.
// Realistically, this should not be needed here but now is required
// as the code depends on this variable existing in multiple areas.
};