-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDisplay.hpp
62 lines (49 loc) · 2.2 KB
/
Display.hpp
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
#ifndef __DISPLAY__
#define __DISPLAY__
#include <iostream>
#include <string>
#include <vector>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include "GameStatus.hpp"
#include "Board.hpp"
#include "Player.hpp"
using namespace std;
using namespace sf;
class Display
{
private:
//Drawing variables
//title of the window
string _Title;
RenderWindow _Window;
//vector of pieces of each player
//vector <Sprite> _Sprites;
//Textures initialization
Texture _TextureBoard, _TextureWhitePlays, _TextureBlackPlays, _TextureWhiteWins, _TextureBlackWins;
Texture _TexturePromotion, _TexturePromWQ, _TexturePromWR, _TexturePromWB, _TexturePromWKN, _TexturePromBQ, _TexturePromBR, _TexturePromBB, _TexturePromBKN;
//Texture _TextureBp, _TextureBb, _TextureBkn, _TextureBr, _TextureBk, _TextureBq, _TextureWp, _TextureWb, _TextureWkn, _TextureWr, _TextureWq, _TextureWk;
//Sprites initializations
Sprite _SpriteBoard, _SpriteWhitePlays, _SpriteBlackPlays, _SpriteWhiteWins, _SpriteBlackWins;
Sprite _SpritePromotion, _SpritePromWQ, _SpritePromWR, _SpritePromWB, _SpritePromWKN, _SpritePromBQ, _SpritePromBR, _SpritePromBB, _SpritePromBKN;
//Sprite _SpriteBb, _SpriteBp, _SpriteBkn, _SpriteBr, _SpriteBq, _SpriteBk, _SpriteWp, _SpriteWb, _SpriteWkn, _SpriteWr, _SpriteWq, _SpriteWk;
int _Size;
//Game variables
Player* _White; //white player
Player* _Black; //black player
Player* _ActivePlayer; //active player
Player* _WaitingPlayer; //waiting player
int _TurnCount; //how many turns have been played
bool _IsWhiteTurn; //indicates who's turn it is
GAMESTATUS _Status; //stores current status of the game
public:
Display(const string name1, const string name2, const string title = "ChessGame");
void playGame();
void isCheck();
void isCheckMate();
void debug() const;
void show(const Sprite* PieceDragged, const bool _IsDragged, const bool endGame);
void promotion(const bool white);
~Display();
};
#endif