-
Notifications
You must be signed in to change notification settings - Fork 0
/
chessbox.h
50 lines (34 loc) · 974 Bytes
/
chessbox.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
#ifndef CHESSBOX_H
#define CHESSBOX_H
#include <QGraphicsRectItem>
#include <QBrush>
#include "chesspiece.h"
#include <QGraphicsSceneMouseEvent>
class ChessPiece;
class ChessBox:public QGraphicsRectItem
{
public:
//Constructor
ChessBox(QGraphicsItem *parent=0);
~ChessBox();
//public member function
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void setColor(QColor color);
void placePiece(ChessPiece *piece);
void resetOriginalColor();
void setOriginalColor(QColor value);
bool getHasChessPiece();
void setHasChessPiece(bool value,ChessPiece *piece = 0);
void checkForCheck();
QString getChessPieceColor() ;
void setChessPieceColor(QString value);
int rowLoc;
int colLoc;
ChessPiece * currentPiece;
private:
QBrush brush;
QColor originalColor;
bool hasChessPiece;
QString chessPieceColor;
};
#endif // CHESSBOX_H