-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfigure.h
More file actions
28 lines (24 loc) · 678 Bytes
/
Copy pathfigure.h
File metadata and controls
28 lines (24 loc) · 678 Bytes
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
#pragma once
#include <QObject>
#include "constants.h"
class Figure : public QObject
{
Q_OBJECT
public:
explicit Figure(QObject *parent = nullptr);
Figure(Color);
void setKing(const bool& val){king = val;}
void setColor(const Color& col){color = col;}
bool isKing(){return king;}
Color getColor(){return color;}
void becomeKing() {king = true;}
void removeKing() {king = false;}
bool getBeat(){return hadBeat;}\
void setBeat(bool beat){hadBeat = beat;}
private:
bool king = false;
Color color; //color of the figure
bool hadBeat = false; /*whether the figure`s previos move was a beat move*/
signals:
public slots:
};