-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGameEngine.h
130 lines (119 loc) · 3.42 KB
/
GameEngine.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#pragma once
#include "MapLoader.h"
#include "Player.h"
#include "Cards.h"
#include "GameObservers.h"
#include <iostream>
#include <fstream>
#include <string>
#include <list>
using namespace std;
class Subject;
class MapDirectoryInit
{
private:
string selectedMapName;
Map* gameMapPtr;
public:
MapDirectoryInit();
~MapDirectoryInit();
//Copy constructor
MapDirectoryInit(const MapDirectoryInit& md);
//Get user selected map file name
string getSelectedMapName();
//Get Map object created in MapLoader constructor
Map* getGameMap();
//Assignment operator
MapDirectoryInit& operator = (const MapDirectoryInit& md);
//I/O operator overloads
friend istream &operator >> (istream &stream, MapDirectoryInit& md);
friend ostream &operator << (ostream &out, const MapDirectoryInit& md);
};
class PlayerListInit
{
private:
int numOfPlayers;
vector<Player*>* playerListPtr;
Deck* deckPtr;
bool phaseObservers;
bool statsObservers;
public:
PlayerListInit();
PlayerListInit(int);
~PlayerListInit();
vector<Player*>* getPlayerList();
int getNumOfPlayers();
Deck* getDeckPtr();
bool getDisplayPhaseInfo();
void setDisplayPhaseInfo(bool);
bool getDisplayStatsInfo();
void setDisplayStatsInfo(bool);
//Copy constructor
PlayerListInit(const PlayerListInit& pl);
//Assignment operator
PlayerListInit& operator = (const PlayerListInit& pl);
//I/O operator overloads
friend istream &operator >> (istream &stream, PlayerListInit& pl);
friend ostream &operator << (ostream &out, const PlayerListInit& pl);
};
class GameInit
{
private:
PlayerListInit* pliPtr;
vector<Player*>* playerListPtr;
Map* gameMapPtr;
Deck* gameDeckPtr;
void startupPhase(vector<Player*>*, Map* );
public:
GameInit(vector<Player*>*, Map*, PlayerListInit*);
~GameInit();
vector<Player*>* getPlayerListPtr();
Map* getGameMapPtr();
Deck* getGameDeckPtr();
PlayerListInit* getpliPtr();
//copy constructor
GameInit(const GameInit& gi);
//assignment operator
GameInit& operator = (const GameInit& gi);
//I/O operator overloads
friend istream &operator >> (istream &stream, GameInit& gi);
friend ostream &operator << (ostream &out, const GameInit& gi);
};
class WarzoneGame : public Subject
{
private:
vector<Player*>* playerListPtr;
Map* gameMapPtr;
Deck* gameDeckPtr;
Player* currentPlayer;
vector<Order*> executionQueue;
int currentPhase;
bool hasWon;
GameInit* gameInitPtr;
public:
WarzoneGame(GameInit*);
~WarzoneGame();
bool ordersRemain();
void reinforcementPhase(Player *player, int numTerrOwned);
void issueOrdersPhase(Player*);
void executeOrdersPhase();
void mainGameLoop();
Player* getCurrentPlayer();
void setCurrentPlayer(Player*);
Map* getGameMap();
void setExecutionQueue();
vector<Order*> getExecutionQueue();
int getCurrentPhase();
void setCurrentPhase(int);
bool getHasWon();
void setHasWon(bool);
GameInit* getGameInitPtr();
vector<Player*> getPlayerList();
//Copy constructor
WarzoneGame(const WarzoneGame& wzg);
//Assignment operator
WarzoneGame& operator = (const WarzoneGame& wzg);
//I/O operator overloads
friend istream &operator >> (istream &stream, WarzoneGame& wzg);
friend ostream &operator << (ostream &out, const WarzoneGame& wzg);
};