-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpiece.h
More file actions
35 lines (30 loc) · 803 Bytes
/
piece.h
File metadata and controls
35 lines (30 loc) · 803 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
29
30
31
32
33
34
35
typedef struct position {
int first;
int second;
};
class Piece {
private:
bool m_alive;
int m_type;
int m_id;
bool m_team;
position m_location;
bool m_hasMoved;
int m_weight;
public:
Piece();
Piece(int type, int id, bool team);
~Piece();
void kill() { m_alive = false; };
void setLocation(position location) { m_location = location; };
void setHasMoved(bool move) {m_hasMoved = move; }
void setType(int type) { m_type = type; };
void setWeight(int weight) { m_weight = weight; };
int getType() { return m_type; };
int getId() { return m_id; };
bool getTeam() { return m_team; };
bool getifAlive() { return m_alive; };
position getLocation() { return m_location; };
bool getIfHasMoved() { return m_hasMoved; }
int getWeight() { return m_weight; }
};