The Pedigree Project
0.1
|
#include <SideState.h>
Public Member Functions | |
SideState () | |
void | friendlyMove (Move m, Piece promotion=Pawn) |
void | enemyMove (Move m, Bitboard enemyPawns) |
bool | isLegal (Move m, Bitboard enemyPieces, Bitboard enemyPawnsEnPassant) |
bool | isCastle (Move m) |
bool | isAttacking (Square sq, Bitboard enemyPieces) |
long | heuristic () |
Square | firstPawn () |
Square | firstRook () |
Square | firstKnight () |
Square | firstBishop () |
Square | firstQueen () |
Square | firstKing () |
Square | next () |
Public Attributes | |
bool | rooksMoved [2] |
bool | kingMoved |
bool | hasCastled |
Bitboard | pawns |
Bitboard | rooks |
Bitboard | bishops |
Bitboard | knights |
Bitboard | queen |
Bitboard | king |
Bitboard | enPassant |
Bitboard | attack |
Bitboard | nextBoard |
int | nextPiece |
A representation of a side (white or black). The representation of each side is the same - each thinks he/she is White (bottom of the board). The BoardState object rotates queries, moves and responses depending on whether this side is actually white or black.
Definition at line 44 of file SideState.h.
SideState::SideState | ( | ) |
Constructor. Starts the state in the normal starting position.
Definition at line 76 of file SideState.cc.
References rooksMoved.
Square SideState::firstPawn | ( | ) |
Accessors for pieces.
Definition at line 92 of file SideState.cc.
References nextBoard, and pawns.
Referenced by BoardState::firstPawn(), and isAttacking().
void SideState::friendlyMove | ( | Move | m, |
Piece | promotion = Pawn |
||
) |
Lets a move be made, regardless of legality.
Definition at line 239 of file SideState.cc.
References attack, Bitboard::clear(), pawns, and Bitboard::set().
Referenced by BoardState::move().
Queries.
Definition at line 139 of file SideState.cc.
References firstPawn(), pawns, and Bitboard::set().
Referenced by BoardState::isLegal().
bool SideState::isCastle | ( | Move | m | ) |
Evaluates to true if the given Move is a castle.
Definition at line 187 of file SideState.cc.
Evaluates to true if the given Move is legal.
Definition at line 194 of file SideState.cc.
References pawns, and rooksMoved.
Referenced by BoardState::isLegal().
Bitboard SideState::attack |
All squares attacked by all pieces.
Definition at line 112 of file SideState.h.
Referenced by friendlyMove().
Bitboard SideState::nextBoard |
Bitboard for the next() function.
Definition at line 117 of file SideState.h.
Referenced by firstPawn().
Bitboard SideState::pawns |
Bitboards.
Definition at line 100 of file SideState.h.
Referenced by BoardState::dump(), BoardState::firstPawn(), firstPawn(), friendlyMove(), isAttacking(), BoardState::isLegal(), isLegal(), and BoardState::move().
bool SideState::rooksMoved[2] |
General state.
Definition at line 93 of file SideState.h.
Referenced by BoardState::firstPawn(), isLegal(), BoardState::save(), and SideState().