![]() |
Cinnamon
1.0
chess engine
|
#include <ChessBoard.h>
Classes | |
struct | _Tboard |
Public Member Functions | |
ChessBoard () | |
virtual | ~ChessBoard () |
void | display () |
char | decodeBoard (string) |
void | setUci (bool) |
bool | getUci () |
int | getPieceByChar (char) |
template<int side> | |
u64 | getBitBoard () |
void | setSide (bool b) |
int | getSide () |
template<int side> | |
int | getPieceAt (u64 bitmapPos) |
Public Attributes | |
string | START_FEN |
Static Public Attributes | |
static const u64 | CENTER_MASK = 0x1818000000ULL |
static const u64 | BIG_DIAG_LEFT = 0x102040810204080ULL |
static const u64 | BIG_DIAG_RIGHT = 0x8040201008040201ULL |
static const int | SQUARE_FREE = 12 |
static const int | PAWN_BLACK = 0 |
static const int | PAWN_WHITE = 1 |
static const int | ROOK_BLACK = 2 |
static const int | ROOK_WHITE = 3 |
static const int | BISHOP_BLACK = 4 |
static const int | BISHOP_WHITE = 5 |
static const int | KNIGHT_BLACK = 6 |
static const int | KNIGHT_WHITE = 7 |
static const int | KING_BLACK = 8 |
static const int | KING_WHITE = 9 |
static const int | QUEEN_BLACK = 10 |
static const int | QUEEN_WHITE = 11 |
Protected Member Functions | |
virtual int | loadFen (string) |
string | decodeBoardinv (const uchar type, const int a, const int side) |
u64 | makeZobristKey () |
template<int side> | |
int | getNpiecesNoPawnNoKing () |
void | updateZobristKey (u64 *key, uchar piece, uchar position) |
Protected Attributes | |
u64 | zobristKey |
int | enpassantPosition |
uchar | RIGHT_CASTLE |
u64 | chessboard [12] |
_Tboard | structure |
bool | sideToMove |
int | friendKing [2] |
Static Protected Attributes | |
static const int | E1 = 3 |
static const int | E8 = 59 |
static const int | C1 = 5 |
static const int | F1 = 2 |
static const int | C8 = 58 |
static const int | F8 = 61 |
static const u64 | BLACK_SQUARES = 0x55AA55AA55AA55AAULL |
static const u64 | WHITE_SQUARES = 0xAA55AA55AA55AA55ULL |
static const uchar | KING_SIDE_CASTLE_MOVE_MASK = 0b00000100 |
static const uchar | QUEEN_SIDE_CASTLE_MOVE_MASK = 0b00001000 |
static const uchar | RIGHT_KING_CASTLE_WHITE_MASK = 0b00010000 |
static const uchar | RIGHT_QUEEN_CASTLE_WHITE_MASK = 0b00100000 |
static const uchar | RIGHT_KING_CASTLE_BLACK_MASK = 0b01000000 |
static const uchar | RIGHT_QUEEN_CASTLE_BLACK_MASK = 0b10000000 |
Definition at line 12 of file ChessBoard.h.
Definition at line 3 of file ChessBoard.cpp.
ChessBoard::~ChessBoard | ( | ) | [virtual] |
Definition at line 10 of file ChessBoard.cpp.
char ChessBoard::decodeBoard | ( | string | a | ) |
Definition at line 171 of file ChessBoard.cpp.
string ChessBoard::decodeBoardinv | ( | const uchar | type, |
const int | a, | ||
const int | side | ||
) | [protected] |
Definition at line 151 of file ChessBoard.cpp.
void ChessBoard::display | ( | ) |
Definition at line 67 of file ChessBoard.cpp.
u64 ChessBoard::getBitBoard | ( | ) | [inline] |
Definition at line 42 of file ChessBoard.h.
int ChessBoard::getNpiecesNoPawnNoKing | ( | ) | [inline, protected] |
Definition at line 104 of file ChessBoard.h.
int ChessBoard::getPieceAt | ( | u64 | bitmapPos | ) | [inline] |
Definition at line 55 of file ChessBoard.h.
int ChessBoard::getPieceByChar | ( | char | c | ) |
Definition at line 61 of file ChessBoard.cpp.
int ChessBoard::getSide | ( | ) | [inline] |
Definition at line 51 of file ChessBoard.h.
bool ChessBoard::getUci | ( | ) |
Definition at line 35 of file ChessBoard.cpp.
int ChessBoard::loadFen | ( | string | fen | ) | [protected, virtual] |
Reimplemented in GenMoves.
Definition at line 185 of file ChessBoard.cpp.
u64 ChessBoard::makeZobristKey | ( | ) | [protected] |
Definition at line 39 of file ChessBoard.cpp.
void ChessBoard::setSide | ( | bool | b | ) | [inline] |
Definition at line 47 of file ChessBoard.h.
void ChessBoard::setUci | ( | bool | b | ) |
Definition at line 23 of file ChessBoard.cpp.
void ChessBoard::updateZobristKey | ( | u64 * | key, |
uchar | piece, | ||
uchar | position | ||
) | [inline, protected] |
Definition at line 108 of file ChessBoard.h.
const u64 ChessBoard::BIG_DIAG_LEFT = 0x102040810204080ULL [static] |
Definition at line 18 of file ChessBoard.h.
const u64 ChessBoard::BIG_DIAG_RIGHT = 0x8040201008040201ULL [static] |
Definition at line 19 of file ChessBoard.h.
const int ChessBoard::BISHOP_BLACK = 4 [static] |
Definition at line 25 of file ChessBoard.h.
const int ChessBoard::BISHOP_WHITE = 5 [static] |
Definition at line 26 of file ChessBoard.h.
const u64 ChessBoard::BLACK_SQUARES = 0x55AA55AA55AA55AAULL [static, protected] |
Definition at line 85 of file ChessBoard.h.
const int ChessBoard::C1 = 5 [static, protected] |
Definition at line 81 of file ChessBoard.h.
const int ChessBoard::C8 = 58 [static, protected] |
Definition at line 83 of file ChessBoard.h.
const u64 ChessBoard::CENTER_MASK = 0x1818000000ULL [static] |
Definition at line 17 of file ChessBoard.h.
u64 ChessBoard::chessboard[12] [protected] |
Definition at line 96 of file ChessBoard.h.
const int ChessBoard::E1 = 3 [static, protected] |
Definition at line 79 of file ChessBoard.h.
const int ChessBoard::E8 = 59 [static, protected] |
Definition at line 80 of file ChessBoard.h.
int ChessBoard::enpassantPosition [protected] |
Definition at line 94 of file ChessBoard.h.
const int ChessBoard::F1 = 2 [static, protected] |
Definition at line 82 of file ChessBoard.h.
const int ChessBoard::F8 = 61 [static, protected] |
Definition at line 84 of file ChessBoard.h.
int ChessBoard::friendKing[2] [protected] |
Definition at line 99 of file ChessBoard.h.
const int ChessBoard::KING_BLACK = 8 [static] |
Definition at line 29 of file ChessBoard.h.
const uchar ChessBoard::KING_SIDE_CASTLE_MOVE_MASK = 0b00000100 [static, protected] |
Definition at line 87 of file ChessBoard.h.
const int ChessBoard::KING_WHITE = 9 [static] |
Definition at line 30 of file ChessBoard.h.
const int ChessBoard::KNIGHT_BLACK = 6 [static] |
Definition at line 27 of file ChessBoard.h.
const int ChessBoard::KNIGHT_WHITE = 7 [static] |
Definition at line 28 of file ChessBoard.h.
const int ChessBoard::PAWN_BLACK = 0 [static] |
Definition at line 21 of file ChessBoard.h.
const int ChessBoard::PAWN_WHITE = 1 [static] |
Definition at line 22 of file ChessBoard.h.
const int ChessBoard::QUEEN_BLACK = 10 [static] |
Definition at line 31 of file ChessBoard.h.
const uchar ChessBoard::QUEEN_SIDE_CASTLE_MOVE_MASK = 0b00001000 [static, protected] |
Definition at line 88 of file ChessBoard.h.
const int ChessBoard::QUEEN_WHITE = 11 [static] |
Definition at line 32 of file ChessBoard.h.
uchar ChessBoard::RIGHT_CASTLE [protected] |
Definition at line 95 of file ChessBoard.h.
const uchar ChessBoard::RIGHT_KING_CASTLE_BLACK_MASK = 0b01000000 [static, protected] |
Definition at line 91 of file ChessBoard.h.
const uchar ChessBoard::RIGHT_KING_CASTLE_WHITE_MASK = 0b00010000 [static, protected] |
Definition at line 89 of file ChessBoard.h.
const uchar ChessBoard::RIGHT_QUEEN_CASTLE_BLACK_MASK = 0b10000000 [static, protected] |
Definition at line 92 of file ChessBoard.h.
const uchar ChessBoard::RIGHT_QUEEN_CASTLE_WHITE_MASK = 0b00100000 [static, protected] |
Definition at line 90 of file ChessBoard.h.
const int ChessBoard::ROOK_BLACK = 2 [static] |
Definition at line 23 of file ChessBoard.h.
const int ChessBoard::ROOK_WHITE = 3 [static] |
Definition at line 24 of file ChessBoard.h.
bool ChessBoard::sideToMove [protected] |
Definition at line 98 of file ChessBoard.h.
const int ChessBoard::SQUARE_FREE = 12 [static] |
Definition at line 20 of file ChessBoard.h.
string ChessBoard::START_FEN |
Definition at line 33 of file ChessBoard.h.
_Tboard ChessBoard::structure [protected] |
Definition at line 97 of file ChessBoard.h.
const u64 ChessBoard::WHITE_SQUARES = 0xAA55AA55AA55AA55ULL [static, protected] |
Definition at line 86 of file ChessBoard.h.
u64 ChessBoard::zobristKey [protected] |
Definition at line 93 of file ChessBoard.h.