Cute Chess 0.1
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

◆ GenericMove() [1/2]

Chess::GenericMove::GenericMove ( )

Constructs a new null (empty) move.

◆ GenericMove() [2/2]

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

Constructs and initializes a new move.

Member Function Documentation

◆ isNull()

bool Chess::GenericMove::isNull ( ) const

Returns true if this is a null move.

◆ operator!=()

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

Returns true if other is different from this move.

◆ operator==()

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

Returns true if other is the same as this move.

◆ promotion()

int Chess::GenericMove::promotion ( ) const

Type of the promotion piece.

◆ setPromotion()

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

Sets the promotion type to pieceType.

◆ setSourceSquare()

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

Sets the source square to square.

◆ setTargetSquare()

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

Sets the target square to square.

◆ sourceSquare()

Square Chess::GenericMove::sourceSquare ( ) const

The source square.

◆ targetSquare()

Square Chess::GenericMove::targetSquare ( ) const

The target square.


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