Changed my email in the copyright statements.
[tagua/yd.git] / src / hlvariant / chess / move.h
blob5c898aba0f1a31aed07056d396bc174983a5f007
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2007 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef HLVARIANT__CHESS__MOVE_H
12 #define HLVARIANT__CHESS__MOVE_H
14 #include "point.h"
15 #include "export.h"
17 namespace HLVariant {
18 namespace Chess {
20 class TAGUA_EXPORT Move {
21 public:
22 enum Type {
23 INVALID = -1,
24 NORMAL,
25 EN_PASSANT_CAPTURE,
26 EN_PASSANT_TRIGGER,
27 KING_SIDE_CASTLING,
28 QUEEN_SIDE_CASTLING,
29 PROMOTION
31 private:
32 Type m_type;
34 Point m_from;
35 Point m_to;
36 int m_promotion;
37 public:
38 Move();
39 Move(const Point& from, const Point& to, int promotionType = -1);
40 virtual ~Move();
42 virtual Point enPassantTrigger() const;
43 virtual Point captureSquare() const;
44 virtual int promoteTo() const;
45 virtual bool kingSideCastling() const;
46 virtual bool queenSideCastling() const;
48 virtual Point from() const;
49 virtual Point to() const;
50 virtual bool valid() const;
52 virtual void setType(Type type);
54 virtual bool operator==(const Move& move) const;
57 } // namespace Chess
58 } // namespace HLVariant
60 #endif // HLVARIANT__CHESS__MOVE_H