-
Notifications
You must be signed in to change notification settings - Fork 0
/
Legion.h
80 lines (78 loc) · 2.32 KB
/
Legion.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
#pragma once
#include<iostream>
#include<vector>
#include<map>
#include"GameBoard.h"
#include "GenericPlayer.h"
#include <thread>
using namespace std;
class Legion
{
public:
Legion();
Legion(char symbol, char enemySymbol, GameBoard *ConnectedBoard);
~Legion();
Legion(const Legion &source);
Legion(Legion &&source);
//Legion &operator=(const Legion &source);
string GetLegionName()const;
string GetLocation()const;
string GetStance()const;
int GetMenCount()const;
string CoordsToSpace(const unsigned int &rowNum,const unsigned int columnNum);
void SetLegionName(int legionCount);
void SetLocation(string &pos, const unsigned int &rowNum, const unsigned int &columnNum, char &symbol);
void SetStance(string stance);
void ClearLocation(const unsigned int &rowNum, const unsigned int &columnNum);
void ClearMorale();
void SetMenCount(int num);
void MoveLegion(char &moveDirection);
void FleeLegion();
void ScoutAdjacents();
void ScoutTargets();
void UpdateLegion();
int ChargeEnemy(Legion &targetedLegion);
void InflictDamage();
void DestroyLegion();
void TakeDamage(int &damage);
void AddEngagedLegion(Legion &targetedLegion);
int GetEngangedCount()const;
int GetFlanksCount()const;
double GetMoraleValue()const;
string GetMoraleStatus()const;
void SetEngagedCount();
void DisengageTargets(vector<Legion> &opponentEnemiesEngaged);
void UpdateMorale();
bool RollMorale();
bool ValidMove(char &moveKey);
bool destroyed = false;
bool isDeployed = false;
bool canMove = true;
bool canAttack = false;
bool inCombat = false;
bool isRetreating = false;
bool canRetreat = false;
bool Fleeing = false;
pair<int, int> legionCoord;
map<string, string> AdjacentSpaces;
map<string, pair<int, int>> AdjacentCoords;
map<string, string> TargetSpaces;
map<string, pair<int, int>> TargetCoords;
vector<Legion*> EnemiesEngaged;
private:
char m_unitSymbol;
char m_enemyUnitSymbol;
int m_LegionMen;
int m_EnemiesEngagedCount;
int m_FlanksCount;
double m_Morale;
const int m_MinDamage = 10;
const int m_MaxDamage = 25;
const double m_BaseMorale;
int damageModifier;
string m_LegionName;
string m_LegionPosition;
string m_Stance;
string m_MoraleStatus;
GameBoard *ConnectedBoard;
};