List of all members
cwchess::Move Class Reference

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.
 

Detailed Description

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.

Definition at line 44 of file Move.h.

Constructor & Destructor Documentation

cwchess::Move::Move ( Index  from,
Index  to,
Type  promotion 
)
inline

Construct a Move from square from to square to.

If this move represents a pawn promotion then promotion must be one of queen, rook, knight, bishop. Otherwise it must be empty.

Definition at line 63 of file Move.h.


The documentation for this class was generated from the following file:

Copyright © 2006 - 2010 Carlo Wood.  All rights reserved.