-
Notifications
You must be signed in to change notification settings - Fork 0
/
piece.hpp
74 lines (66 loc) · 1.02 KB
/
piece.hpp
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
69
70
71
72
73
74
#ifndef PIECE_HPP
#define PIECE_HPP
#include <iostream>
#include "square.hpp"
#include <string>
class square;
class piece
{
protected:
std::string name;
public:
bool isWhite;
virtual bool checkMove(square a, square b);
std::string getName();
virtual bool event();
virtual void setEvent();
};
class king : public piece
{
private:
bool hasMoved;
public:
king(bool w);
bool checkMove(square a, square b);
bool event();
void setEvent();
};
class queen : public piece
{
public:
queen(bool w);
bool checkMove(square a, square b);
};
class knight : public piece
{
public:
knight(bool w);
bool checkMove(square a, square b);
};
class bishop : public piece
{
public:
bishop(bool w);
bool checkMove(square a, square b);
};
class pawn : public piece
{
private:
bool lastMove;
public:
pawn(bool w);
bool checkMove(square a, square b);
bool event();
void setEvent();
};
class rook : public piece
{
private:
bool hasMoved;
public:
rook(bool w);
bool checkMove(square a, square b);
bool event();
void setEvent();
};
#endif