Ported crazyhouse piece. Working on crazyhouse game state.
[tagua.git] / src / hlvariant / chess / piece.h
blobb6e60488f203b0df984ec10695dda4fba53b4504
1 #ifndef HLVARIANT__CHESS__PIECE_H
2 #define HLVARIANT__CHESS__PIECE_H
4 #include <QString>
5 #include "export.h"
7 namespace HLVariant {
8 namespace Chess {
10 class TAGUA_EXPORT Piece {
11 public:
12 enum Color {
13 INVALID_COLOR = -1,
14 WHITE,
15 BLACK
17 enum Type {
18 INVALID_TYPE = -1,
19 PAWN,
20 KNIGHT,
21 BISHOP,
22 ROOK,
23 QUEEN,
24 KING
26 private:
27 Color m_color;
28 Type m_type;
29 public:
30 Piece(Color color = INVALID_COLOR, Type type = INVALID_TYPE);
31 virtual ~Piece();
33 virtual Color color() const;
34 virtual Type type() const;
36 virtual QString colorName() const;
37 static QString colorName(Color color);
38 virtual QString typeName() const;
39 static QString typeName(Type type);
40 virtual QString name() const;
42 static Color oppositeColor(Color color);
44 virtual bool operator==(const Piece& other) const;
45 virtual bool operator!=(const Piece& other) const;
48 } // namespace Chess
49 } // namespace HLVariant
51 #endif // HLVARIANT__CHESS__PIECE_H