-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPiece.h
More file actions
49 lines (41 loc) · 1011 Bytes
/
Piece.h
File metadata and controls
49 lines (41 loc) · 1011 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef PIECE_H
#define PIECE_H
#include "Point.h"
enum Piece_color { black, white};
enum Piece_type {pawn,knight,kind};
class Piece
{
friend ostream& operator<<(ostream&, const Piece*);
friend ostream& operator<<(ostream&, const Piece&);
public:
Piece(Piece_color color, Piece_type _type);
virtual ~Piece() {}
virtual bool chek_move(const Point& from, const Point& to) const = 0;
Piece_color get_color() const;
private:
Piece_color _color;
Piece_type _type;
virtual string print() const = 0;
};
class Pawn : public Piece
{
public:
Pawn(Piece_color color);
virtual bool chek_move(const Point& from, const Point& to) const;
virtual string print() const;
};
class Knight : public Piece
{
public:
Knight(Piece_color color);
virtual bool chek_move(const Point& from, const Point& to) const;
virtual string print() const;
};
class Kind : public Piece
{
public:
Kind(Piece_color color);
virtual bool chek_move(const Point& from, const Point& to) const;
virtual string print() const;
};
#endif