-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgame.h
56 lines (45 loc) · 1.2 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
#ifndef GAME_H
#define GAME_H
#include <QGraphicsView>
#include <QGraphicsScene>
#include <chessboard.h>
#include "chesspiece.h"
class Game:public QGraphicsView
{
Q_OBJECT
public:
//Constructors
Game(QWidget *parent = 0);
//public Methods
void drawDeadHolder(int x, int y, QColor color);
void drawChessBoard();
void displayDeadWhite();
void displayDeadBlack();
void placeInDeadPlace(ChessPiece *piece);
//Scene Related
void addToScene(QGraphicsItem *item);
void removeFromScene(QGraphicsItem *item);
//getters/setters
ChessPiece *pieceToMove;
QString getTurn() ;
void setTurn( QString value);
void changeTurn();
ChessBox *collection[8][8];
QGraphicsTextItem *check;
QList <ChessPiece *> alivePiece;
void displayMainMenu();
void gameOver();
void removeAll();
public slots:
void start();
private:
QGraphicsScene *gameScene;
QList <ChessPiece *> whiteDead;
QList <ChessPiece *> blackDead;
QGraphicsRectItem * deadHolder;
QString turn;
ChessBoard *chess;
QList <QGraphicsItem *> listG;
QGraphicsTextItem * turnDisplay;
};
#endif // GAME_H