-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenericPlayer.h
59 lines (55 loc) · 1.51 KB
/
GenericPlayer.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
#pragma once
#include<iostream>
#include<vector>
#include "GameBoard.h"
#include "Legion.h"
class Legion;
struct BoardIndex;
using namespace std;
class GenericPlayer
{
public:
GenericPlayer();
GenericPlayer(GameBoard*board, string name, vector<GenericPlayer*> &playerlist);
~GenericPlayer();
bool isTurn = false;
bool isReady = false;
bool inBattleStage = false;
bool winner = false;
bool loser = false;
int GetLegionCount()const;
int GetMovableLegions()const;
int GetTotalMen()const;
string GetPlayerName()const;
BoardIndex SearchSpace(string &input, char &letter, int &number);
void PassBoardandName(GameBoard* board, string name);
void PlaceLegion(string input, const unsigned int rowNum, const unsigned int columnNum);
void RemoveLegion(string input, const unsigned int rowNum, const unsigned int columnNum);
int MoveLegions(char moveDir);
int DisengagementCasualties();
void UpdateBattle();
void UpdateTotalMen();
void SetOpponent();
void SetLegionCount();
bool IsInDeploymentZone(string input);
bool RollDisengagement();
vector<Legion> LegionList;
private:
protected:
string m_Pname;
static int numPlayers;
const int maxLegions = 7;
int availableLegions = 0;
int deployedLegions = 0;
int totalMen = 0;
char unitSymbol;
GameBoard *ConnectedBoard;
Legion *SelectedLegion;
GenericPlayer *Opponent;
vector<GenericPlayer*> *PlayerList;
};
struct BoardIndex {
int rows;
int columns;
bool Placing = true;
};