A chess move in a particular chess position. More...
#include <Move.h>
Public Member Functions | |
Constructors | |
Move (void) | |
Construct an uninitialized Move. | |
Move (Index from, Index to, Type promotion) | |
Construct a Move from square from to square to. More... | |
Move (Move const& move) | |
Copy-constructor. | |
Assignment operator | |
Move& | operator= (Move const& move) |
Comparision operators | |
bool | operator== (Move const& move) const |
bool | operator!= (Move const& move) const |
Accessors | |
bool | is_promotion (void) const |
Return TRUE if this move is a pawn promotion. | |
Index | from (void) const |
Return the square the piece moves from. | |
Index | to (void) const |
Return the square the piece moves to. | |
Type | promotion_type (void) const |
Return the promotion type. Returns empty if this isn't a promotion. | |
Manipulators | |
void | set_promotion (Type promotion) |
Set a different promotion type. | |
void | set_to (Index to) |
Set different target square. | |
void | set_move (Index from, Index to, Type promotion) |
Set from, to and promotion type. | |
A chess move in a particular chess position.
This class represents a move as can be done in a particular chess position. That means that it cannot be used to do the same move in another position where that move is possible too. The reason for that is that it's internal representation only stores the squares, and not piece information.
A Move is therefore always used in combination with a ChessPosition.