-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGameEngine.h
84 lines (70 loc) · 1.62 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
#pragma once
#include "GameEngine.h"
#include "CommandProcessing.h"
#include "Map.h"
#include "Orders.h";
#include "Player.h"
#include <vector>
#include <iostream>
#include <string>
#include <algorithm>
enum RiskState {
START, MAPLOADED, MAPVALIDATED, PLAYERSADDED, ASSIGNMENTREIFORCEMENT, ISSUEORDERS, EXECUTEORDERS, WIN
};
class Map;
class MapLoader;
class Territory;
class Deck;
class Player;
class GameEngine {
public:
GameEngine();
GameEngine(bool, bool);
GameEngine(const GameEngine& g);
GameEngine& operator=(const GameEngine& g);
friend std::istream& operator>>(std::istream& in, GameEngine& g);
friend std::ostream& operator<<(std::ostream& out, const GameEngine& g);
~GameEngine();
void loadMap();
void validateMap();
void addPlayer();
void issueOrder();
void executeOrder();
void endExecuteOrder();
void win();
bool getStartUp();
bool getPlay();
void setStartUp(bool);
void setPlay(bool);
void currentState();
void changeState();
//
Map* theMap;
MapLoader* loader;
vector<Territory>* loadedMap;
vector<Player*> players;
FileCommandProcessorAdapter processor;
CommandProcessor* cp = new CommandProcessor();
FileLineReader* flr = new FileLineReader();
static int CommandCount;
ifstream inFile;
Deck* deck;
//states
void Start();
void MapLoaded();
void MapValidated();
void PlayersAdded();
void AssignReinforcement();
void reinforcmentPhase(); // reinforcment phase part 3.1
void issueOrdersPhase(); // issue Orders phase part 3.2
void IssueOrders();
void ExecuteOrders();
void Win();
//loops
void StartupPhase();
void play();
private:
void executeOrderPhase();
bool StartUp;
bool Play;
};