Scid  4.7.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
PieceList Class Reference

Store the type and position of the pieces compatibly with the SCID4 coding. More...

#include <fastgame.h>

Public Member Functions

int8_t getKingIdx () const
 SCID4 encoded games must use index 0 for kings. More...
 
pieceT getPieceType (colorT color, int idx) const
 Return the type of the piece with index idx. More...
 
squareT getSquare (colorT color, int idx) const
 Return the square position of the piece with index idx. More...
 
void move (colorT color, int idx, squareT to)
 Change the square position of the piece with index idx. More...
 
void promote (colorT color, int idx, pieceT piece_type)
 Change the type of the piece with index idx. More...
 
squareT remove (colorT color, int removed_idx, int lastvalid_idx)
 Remove the piece with index removed_idx. More...
 
void set (colorT color, int idx, squareT sq, pieceT piece_type)
 Set the type and square of the piece with index idx. More...
 

Detailed Description

Store the type and position of the pieces compatibly with the SCID4 coding.

Definition at line 82 of file fastgame.h.

Member Function Documentation

◆ getKingIdx()

int8_t PieceList::getKingIdx ( ) const
inline

SCID4 encoded games must use index 0 for kings.

Definition at line 90 of file fastgame.h.

◆ getPieceType()

pieceT PieceList::getPieceType ( colorT  color,
int  idx 
) const
inline

Return the type of the piece with index idx.

Definition at line 93 of file fastgame.h.

◆ getSquare()

squareT PieceList::getSquare ( colorT  color,
int  idx 
) const
inline

Return the square position of the piece with index idx.

Definition at line 101 of file fastgame.h.

◆ move()

void PieceList::move ( colorT  color,
int  idx,
squareT  to 
)
inline

Change the square position of the piece with index idx.

Definition at line 109 of file fastgame.h.

◆ promote()

void PieceList::promote ( colorT  color,
int  idx,
pieceT  piece_type 
)
inline

Change the type of the piece with index idx.

Definition at line 117 of file fastgame.h.

◆ remove()

squareT PieceList::remove ( colorT  color,
int  removed_idx,
int  lastvalid_idx 
)
inline

Remove the piece with index removed_idx.

Piece's indexes are important for decoding SCID4 moves: when a piece is removed it's index is used by the last valid index lastvalid_idx. Return the square of the new piece with index removed_idx.

Definition at line 128 of file fastgame.h.

◆ set()

void PieceList::set ( colorT  color,
int  idx,
squareT  sq,
pieceT  piece_type 
)
inline

Set the type and square of the piece with index idx.

Definition at line 138 of file fastgame.h.

Member Data Documentation

◆ piece_type

pieceT PieceList::piece_type

Definition at line 85 of file fastgame.h.

◆ sq

squareT PieceList::sq

Definition at line 84 of file fastgame.h.


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