-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPiece.h
93 lines (82 loc) · 1.75 KB
/
Piece.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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* Header de Piece.cxx
*
* @file Piece.h
*/
#if !defined Piece_h
#define Piece_h
#include "Echiquier.h"
//class Echiquier;
/**
* Declaration d'une classe mod�lisant une piece de jeu d'echec.
*/
class Piece
{
private:
int m_x;
int m_y;
bool m_white;
public:
Piece();
Piece(int x, int y, bool white);
~Piece();
void init( int x, int y, bool white );
void move( int x, int y );
int x() const;
int y() const;
bool isWhite() const;
bool isBlack() const;
void affiche() const;
const Piece & plusForte(const Piece & p);
virtual bool mouvementValide(Echiquier &e, int x, int y);
virtual char name();
};
class Pion : public Piece
{
public:
Pion(int x, int y, bool white) : Piece(x, y, white) {};
//~Pion() {}
bool mouvementValide( Echiquier & e, int x, int y );
char name();
};
class Tour : public Piece
{
public:
Tour(int x, int y, bool white) : Piece(x, y, white) {};
//~Tour() {}
bool mouvementValide( Echiquier & e, int x, int y );
char name();
};
class Cavalier : public Piece
{
public:
Cavalier(int x, int y, bool white) : Piece(x, y, white) {};
//~Cavalier() {}
bool mouvementValide( Echiquier & e, int x, int y );
char name();
};
class Fou : public Piece
{
public:
Fou(int x, int y, bool white) : Piece(x, y, white) {};
//~Fou() {}
bool mouvementValide( Echiquier & e, int x, int y );
char name();
};
class Reine : public Piece
{
public:
Reine(int x, int y, bool white) : Piece(x, y, white) {};
//~Reine() {}
bool mouvementValide( Echiquier & e, int x, int y );
char name();
};
class Roi : public Piece
{
public:
Roi(int x, int y, bool white) : Piece(x, y, white) {};
//~Roi() {}
bool mouvementValide( Echiquier & e, int x, int y );
char name();
};
#endif // !defined Piece_h