-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameEngine.h
More file actions
61 lines (52 loc) · 2.07 KB
/
GameEngine.h
File metadata and controls
61 lines (52 loc) · 2.07 KB
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
#pragma once
#include <string>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <vector>
#include "CommandProcessing.h"
#include "LoggingObserver.h"
using namespace std;
// Forward declarations
class CommandProcessor;
class Player;
class Map;
class Deck;
// Finite State Enum
// enum GameState;
// Game Engine class
class GameEngine : public Subject, public ILoggable{
private:
// pointer data member for Game States
GameState* currentState;
public:
// default constructor
GameEngine();
// copy constrcutor
GameEngine(const GameEngine& other);
// assignment operator
GameEngine& operator=(const GameEngine& other);
// destructor
~GameEngine();
// function to transition between states
void transition(const string& command);
// function to handle the startup phase
void startupPhase(CommandProcessor*& commandProcessor, Map*& map, vector<Player*>*& players, Deck*& deck);
// function to process the startup phase (assign territories, determine order of play, etc.)
void startupPhaseProcess(CommandProcessor*& commandProcessor, Map*& map, vector<Player*>*& players, Deck*& deck);
// function to handle the main game loop
void mainGameLoop(CommandProcessor*& commandProcessor, Map*& map, vector<Player*>*& players, Deck*& deck);
// function to distribute reinforcements to players
void reinforcementPhase(Map*& map, vector<Player*>*& players);
// function to issue orders to players
void issueOrdersPhase(vector<Player*>*& players, Deck*& deck);
// function to execute orders
void executeOrdersPhase(vector<Player*>*& players);
string stringToLog() const override;
// stream inssertion operator overload
friend ostream& operator << (ostream& os, const GameEngine& gEngine);
// Tournament mode function
void runTournament(const vector<string>& maps, const vector<string>& strategies, int gamesPerMap, int maxTurns);
// For testing/debugging
string getStateString() const;
};