-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWidget.h
68 lines (54 loc) · 1.5 KB
/
Widget.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
#ifndef WIDGET_H
#define WIDGET_H
#include <cmath>
#include <QWidget>
#include <QPainter>
#include <QDebug>
#include <QMouseEvent>
#include <QPoint>
#include <QListView>
#include <QStandardItem>
#include <QStandardItemModel>
#include "Position.h"
#include "PiecesManipulator.h"
#include "BoardInterface.h"
#include "Board.h"
#include "ChessPiece.h"
#include "Pawn.h"
#include "King.h"
#include "Movement.h"
#include "SimpleMovement.h"
#include "ComplexMovement.h"
#include "MovesListModel.h"
using namespace Chess::GameLogic::GameComponents;
using namespace Chess::ChessComponents::ChessPieces;
class Widget : public QWidget
{
Q_OBJECT
public:
Widget( QWidget* parent = 0 );
~Widget();
void setMovesListModel( MovesListModel* model );
void setInterface( const BoardInterface& interface );
BoardInterface interface() const;
void setView( QListView* view );
QListView* view() const;
void chichuAdi( QPainter& painter,
const int x = 0,
const int y = 0,
const int size = 5,
const int xOffset = 0,
const int yOffset = 0 );
protected:
virtual void paintEvent( QPaintEvent* event );
virtual void mouseReleaseEvent( QMouseEvent* event );
signals:
void clickCell( QPoint point );
public slots:
void movesListItemClicked( QModelIndex );
void figureSelectedListener( const Position& );
private:
QListView* m_view;
BoardInterface m_interface;
};
#endif // WIDGET_H