Cute Chess  0.1
Public Member Functions | List of all members
Chess::GenericMove Class Reference

A chess move independent of chess variant or opening book format. More...

#include <genericmove.h>

Public Member Functions

 GenericMove ()
 
 GenericMove (const Square &sourceSquare, const Square &targetSquare, int promotion)
 
bool isNull () const
 
bool operator!= (const GenericMove &other) const
 
bool operator== (const GenericMove &other) const
 
int promotion () const
 
void setPromotion (int pieceType)
 
void setSourceSquare (const Square &square)
 
void setTargetSquare (const Square &square)
 
Square sourceSquare () const
 
Square targetSquare () const
 

Detailed Description

A chess move independent of chess variant or opening book format.

When a move is made by a human or retrieved from an opening book of any kind, it will be in this format. Later it can be converted to Chess::Move by a Chess::Board object.

Constructor & Destructor Documentation

Chess::GenericMove::GenericMove ( )

Constructs a new null (empty) move.

Chess::GenericMove::GenericMove ( const Square sourceSquare,
const Square targetSquare,
int  promotion 
)

Constructs and initializes a new move.

Member Function Documentation

bool Chess::GenericMove::isNull ( ) const

Returns true if this is a null move.

bool Chess::GenericMove::operator!= ( const GenericMove other) const

Returns true if other is different from this move.

bool Chess::GenericMove::operator== ( const GenericMove other) const

Returns true if other is the same as this move.

int Chess::GenericMove::promotion ( ) const

Type of the promotion piece.

void Chess::GenericMove::setPromotion ( int  pieceType)

Sets the promotion type to pieceType.

void Chess::GenericMove::setSourceSquare ( const Square square)

Sets the source square to square.

void Chess::GenericMove::setTargetSquare ( const Square square)

Sets the target square to square.

Square Chess::GenericMove::sourceSquare ( ) const

The source square.

Square Chess::GenericMove::targetSquare ( ) const

The target square.


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