-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoardInterface.h
52 lines (38 loc) · 1.18 KB
/
BoardInterface.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
#ifndef BOARDINTERFACE_H
#define BOARDINTERFACE_H
#include <QBitmap>
#include <QColor>
#include <QImage>
#include <QLabel>
#include <QPainter>
#include <QDebug>
#include <QPushButton>
#include "Board.h"
#include "Position.h"
class QWidget;
using namespace Chess::ChessComponents::PlayField;
class BoardInterface
{
public:
static const int X_OFFSET;
static const int Y_OFFSET;
static const QString IMG_FOLDER;
static const QString EXT;
public:
BoardInterface( Board* board = 0 );
void drawBoard( QPainter& painter );
void drawChessPiece( QPainter& painter, ChessPiece* chessPiece = 0 );
BoardInterface& operator=( const BoardInterface& other );
void setSelectedPosition( const Position& position );
Position selectedPosition() const;
private:
QColor alternateColour( const QColor& colour );
void drawPosition( QPainter& painter, const Position& position, const QColor& colour, bool bordered = true );
void drawNotationRulers( QPainter& painter );
void markAllowedMovements( QPainter& painter, ChessPiece* chessPiece );
private:
Board* m_board;
QWidget* m_parent;
Position m_selectedPosition;
};
#endif // BOARDINTERFACE_H