-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
92 lines (72 loc) · 2.24 KB
/
game.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
#ifndef GAME_H
#define GAME_H
#include "mainwindow.h"
#include "unite.h"
#include "dialogbuyterre.h"
#include "dialogbuyair.h"
#include "bluemoonwin.h"
#include "orangestarwin.h"
#include "dialognewgame.h"
class Game{
public:
static Game& Instance();
void mouseLeftPressed(int x,int y);
void mouseRightPressed(int x, int y);
void start(MainWindow &wind);
void setgameType(int type);
void turnChange();
void createUnit(int x, int y, char type, bool team, int unitWanted);
void endGame();
void restart(int gameType);
int getXCoordinate(QMouseEvent *e);
int getYCoordinate(QMouseEvent *e);
int getIndexUnit(int x, int y);
bool isActiveturn();
Unite* getUnite(int x, int y);
~Game();
private:
Game();
void move(int x, int y);
void selectUnits(int x, int y);
void attack(int x, int y);
void setMapObjectfalse();
void setUnitefalse();
void calculatePosAccessible(int Xfoc, int Yfoc, int indexUnit, int mp);
void iA(bool team);
void iAcreateUnit(bool team);
void iAmoveUnit(bool team);
void updateMoneyTeam(bool team);
void setMoney(bool team, int impact);
void capture(bool turn);
void giveBuildingsPtCapture();
void cureUnit(bool turn);
void fusion(Unite* u1, Unite* u2);
void checkEndGame();
void showInfo(int x, int y);
void victoireBleu();
void victoireOrange();
int getMalusMove(char moveType, int terrainID);
int getmapId(int x, int y);
int attackChart(Unite* a, Unite* d);
int calculDegat(Unite* u, Unite* v);
bool isThereAnotherUnite(int x, int y, int indexUnitFoc);
bool Enemyclose(Unite* unit);
bool capturableIDbuilding(int x, int y, bool team);
static Game gInstance;
MainWindow *window;
vector<Unite*> unite;
int Xfoc = -1;
int Yfoc = -1;
int moneyTeamF = 0; // Blue Moon
int moneyTeamT = 0; // Orange Star
int m_gameType = 1;
bool activeTurn =false;
DialogBuyTerre *diaBuyTerreOS = nullptr;
DialogBuyAir *diaBuyAirOS = nullptr;
DialogBuyTerre *diaBuyTerreBM = nullptr;
DialogBuyAir *diaBuyAirBM = nullptr;
BlueMoonWin *diaWinBlue = nullptr;
OrangeStarWin *diaWinOrange = nullptr;
DialogNewGame *diaNewGame = nullptr;
};
#endif // GAME_H