UCILoader 1.1.2
Small C++ library that allows user to connect to a chess engines via UCI protocol.
Loading...
Searching...
No Matches
StandardChess::StandardChessMove Struct Reference

Standard chess move representation. More...

#include <StandardChess.h>

Public Member Functions

bool operator== (const StandardChessMove &other) const
 Equality operator for unit testing.
 
StandardChessMoveoperator= (const StandardChessMove &other)
 Assignment operator.
 

Public Attributes

unsigned char from
 Source square (0-63)
 
unsigned char to
 Destination square (0-63)
 
PromotionTarget promoteTo
 Promotion target (None for non-promotions)
 

Detailed Description

Standard chess move representation.

Represents a single move in standard chess using:

  • from: Source square (0-63, rank 8 to rank 1, files a-h)
  • to: Destination square (0-63)
  • promoteTo: Promotion target if applicable, or None

Square Numbering: Squares are numbered 0-63 with the formula:

square = 8 * (8 - rank) + (file - 'a')

where rank is 1-8 and file is 'a'-'h'.

Examples:

  • a1 = 56, h1 = 63
  • a8 = 0, h8 = 7
  • e4 = 36
See also
createMove() for convenient move creation
stringValueOf() for converting to UCI notation

Member Function Documentation

◆ operator=()

StandardChessMove & StandardChess::StandardChessMove::operator= ( const StandardChessMove other)
inline

Assignment operator.

Parameters
otherThe move to assign from
Returns
Reference to this move

◆ operator==()

bool StandardChess::StandardChessMove::operator== ( const StandardChessMove other) const
inline

Equality operator for unit testing.

Parameters
otherThe move to compare with
Returns
True if all fields match

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