Chess 0.0.1
A library written in c
Loading...
Searching...
No Matches
ChessPosition Struct Reference

Represents the position in a chess game. More...

#include <position.h>

Data Fields

ChessPiece board [128]
 
ChessSquare pieces [CHESS_COLOR_BLACK+1][CHESS_PIECE_TYPE_KING+1][12]
 
uint8_t piece_counts [CHESS_COLOR_BLACK+1][CHESS_PIECE_TYPE_KING+1]
 
uint8_t piece_indices [128]
 
ChessColor side_to_move
 
ChessCastlingRights castling_rights
 
ChessSquare en_passant_square
 
unsigned int half_move_clock
 
unsigned int full_move_number
 
ChessPositionCounter position_counter
 

Detailed Description

Represents the position in a chess game.

Field Documentation

◆ board

ChessPiece ChessPosition::board[128]

Array representing the pieces on each square (0x88 board).

◆ castling_rights

ChessCastlingRights ChessPosition::castling_rights

The current castling rights for both sides.

◆ en_passant_square

ChessSquare ChessPosition::en_passant_square

The square over which a pawn has just passed while moving two squares, or CHESS_SQUARE_NONE if not available.

◆ full_move_number

unsigned int ChessPosition::full_move_number

The number of the full moves. It starts at 1 and is incremented after Black's move.

◆ half_move_clock

unsigned int ChessPosition::half_move_clock

The number of halfmoves since the last capture or pawn advance, used for the fifty-move rule.

◆ piece_counts

uint8_t ChessPosition::piece_counts[CHESS_COLOR_BLACK+1][CHESS_PIECE_TYPE_KING+1]

Array storing the count of each piece type for both colors.

◆ piece_indices

uint8_t ChessPosition::piece_indices[128]

Array storing the index of the piece on each square in the piece list

◆ pieces

ChessSquare ChessPosition::pieces[CHESS_COLOR_BLACK+1][CHESS_PIECE_TYPE_KING+1][12]

Array storing the squares of each piece type for both colors.

◆ position_counter

ChessPositionCounter ChessPosition::position_counter

Counter for position repetitions (for threefold repetition rule).

◆ side_to_move

ChessColor ChessPosition::side_to_move

The color of the side to move next.


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