-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hex.h
41 lines (33 loc) · 897 Bytes
/
Hex.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
#ifndef HEX_H
#define HEX_H
#include<QGraphicsPolygonItem>
#include <QGraphicsSceneMouseEvent>
class Hex: public QGraphicsPolygonItem{
public:
//constructors
Hex(QGraphicsItem* parent=NULL);
//getters
int getAttackOf(int side);
bool CheckifPlaced();
QString getOwner();
//event
void mousePressEvent(QGraphicsSceneMouseEvent *event);
//setters
void setAttackOf(int side,int attackValue);
void setOwner(QString player);
void setIsPlaced(bool truth);
void displaySideAttacks();
void createLines();
void findNeighbours();
void switchOwner();
void captureNeigbour();
private:
//attributes
QList<QGraphicsLineItem*> lines;
QList<Hex*> neighbours;
bool isPlaced;
QString owner;
int *SideAttackValues;
QList<QGraphicsTextItem*> attackTexts;
};
#endif // HEX_H