Cinnamon  1.1
chess engine
ChessBoard Class Reference

#include <ChessBoard.h>

Inheritance diagram for ChessBoard:
GenMoves Eval Search IterativeDeeping

List of all members.

Classes

struct  _Tboard

Public Member Functions

 ChessBoard ()
virtual ~ChessBoard ()
void display ()
string getFen ()
char decodeBoard (string)
int getPieceByChar (char)
template<int side>
u64 getBitBoard ()
void setSide (bool b)
int getSide ()
template<int side>
int getPieceAt (u64 bitmapPos)

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
static const int NO_ENPASSANT = -1

Protected Member Functions

virtual int loadFen (string)
string decodeBoardinv (const uchar type, const int a, const int side)
void makeZobristKey ()
template<int side>
int getNpiecesNoPawnNoKing ()

Protected Attributes

u64 zobristKey
int enpassantPosition
uchar rightCastle
u64 chessboard [12]
_Tboard structure
bool sideToMove
int friendKing [2]

Static Protected Attributes

static const u64 A7bit = 0x80000000000000ULL
static const u64 B7bit = 0x40000000000000ULL
static const u64 C6bit = 0x200000000000ULL
static const u64 A6bit = 0x800000000000ULL
static const u64 H7bit = 0x1000000000000ULL
static const u64 G7bit = 0x2000000000000ULL
static const u64 F6bit = 0x40000000000ULL
static const u64 H6bit = 0x10000000000ULL
static const u64 A8bit = 0x8000000000000000ULL
static const u64 H8bit = 0x100000000000000ULL
static const u64 A2bit = 0x8000ULL
static const u64 B2bit = 0x4000ULL
static const u64 A3bit = 0x800000ULL
static const u64 H2bit = 0x100ULL
static const u64 G2bit = 0x200ULL
static const u64 H3bit = 0x10000ULL
static const u64 A1bit = 0x80ULL
static const u64 H1bit = 0x1ULL
static const u64 B5bit = 0x4000000000ULL
static const u64 G5bit = 0x200000000ULL
static const u64 B4bit = 0x40000000ULL
static const u64 G4bit = 0x2000000ULL
static const u64 F1G1bit = 0x6ULL
static const u64 H1H2G1bit = 0x103ULL
static const u64 C1B1bit = 0x60ULL
static const u64 A1A2B1bit = 0x80c0ULL
static const u64 F8G8bit = 0x600000000000000ULL
static const u64 H8H7G8bit = 0x301000000000000ULL
static const u64 C8B8bit = 0x6000000000000000ULL
static const u64 A8A7B8bit = 0xc080000000000000ULL
static const u64 C6A6bit = 0xa00000000000ULL
static const u64 F6H6bit = 0x50000000000ULL
static const u64 A7C7bit = 0xa0000000000000ULL
static const u64 H7G7bit = 0x3000000000000ULL
static const u64 C3A3bit = 0xa00000ULL
static const u64 F3H3bit = 0x50000ULL
static const u64 A2C2bit = 0xa000ULL
static const u64 H2G2bit = 0x300ULL
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

Constructor & Destructor Documentation

ChessBoard::~ChessBoard ( ) [virtual]

Member Function Documentation

char ChessBoard::decodeBoard ( string  a)
string ChessBoard::decodeBoardinv ( const uchar  type,
const int  a,
const int  side 
) [protected]
template<int side>
u64 ChessBoard::getBitBoard ( ) [inline]
string ChessBoard::getFen ( )
template<int side>
int ChessBoard::getNpiecesNoPawnNoKing ( ) [inline, protected]
template<int side>
int ChessBoard::getPieceAt ( u64  bitmapPos) [inline]
int ChessBoard::getPieceByChar ( char  c)
int ChessBoard::getSide ( ) [inline]
int ChessBoard::loadFen ( string  fen) [protected, virtual]

Reimplemented in GenMoves.

void ChessBoard::makeZobristKey ( ) [protected]
void ChessBoard::setSide ( bool  b) [inline]

Member Data Documentation

const u64 ChessBoard::A1A2B1bit = 0x80c0ULL [static, protected]
const u64 ChessBoard::A1bit = 0x80ULL [static, protected]
const u64 ChessBoard::A2bit = 0x8000ULL [static, protected]
const u64 ChessBoard::A2C2bit = 0xa000ULL [static, protected]
const u64 ChessBoard::A3bit = 0x800000ULL [static, protected]
const u64 ChessBoard::A6bit = 0x800000000000ULL [static, protected]
const u64 ChessBoard::A7bit = 0x80000000000000ULL [static, protected]
const u64 ChessBoard::A7C7bit = 0xa0000000000000ULL [static, protected]
const u64 ChessBoard::A8A7B8bit = 0xc080000000000000ULL [static, protected]
const u64 ChessBoard::A8bit = 0x8000000000000000ULL [static, protected]
const u64 ChessBoard::B2bit = 0x4000ULL [static, protected]
const u64 ChessBoard::B4bit = 0x40000000ULL [static, protected]
const u64 ChessBoard::B5bit = 0x4000000000ULL [static, protected]
const u64 ChessBoard::B7bit = 0x40000000000000ULL [static, protected]
const u64 ChessBoard::BIG_DIAG_LEFT = 0x102040810204080ULL [static]
const u64 ChessBoard::BIG_DIAG_RIGHT = 0x8040201008040201ULL [static]
const int ChessBoard::BISHOP_BLACK = 4 [static]
const int ChessBoard::BISHOP_WHITE = 5 [static]
const u64 ChessBoard::BLACK_SQUARES = 0x55AA55AA55AA55AAULL [static, protected]
const int ChessBoard::C1 = 5 [static, protected]
const u64 ChessBoard::C1B1bit = 0x60ULL [static, protected]
const u64 ChessBoard::C3A3bit = 0xa00000ULL [static, protected]
const u64 ChessBoard::C6A6bit = 0xa00000000000ULL [static, protected]
const u64 ChessBoard::C6bit = 0x200000000000ULL [static, protected]
const int ChessBoard::C8 = 58 [static, protected]
const u64 ChessBoard::C8B8bit = 0x6000000000000000ULL [static, protected]
const u64 ChessBoard::CENTER_MASK = 0x1818000000ULL [static]
u64 ChessBoard::chessboard[12] [protected]
const int ChessBoard::E1 = 3 [static, protected]
const int ChessBoard::E8 = 59 [static, protected]
const int ChessBoard::F1 = 2 [static, protected]
const u64 ChessBoard::F1G1bit = 0x6ULL [static, protected]
const u64 ChessBoard::F3H3bit = 0x50000ULL [static, protected]
const u64 ChessBoard::F6bit = 0x40000000000ULL [static, protected]
const u64 ChessBoard::F6H6bit = 0x50000000000ULL [static, protected]
const int ChessBoard::F8 = 61 [static, protected]
const u64 ChessBoard::F8G8bit = 0x600000000000000ULL [static, protected]
int ChessBoard::friendKing[2] [protected]
const u64 ChessBoard::G2bit = 0x200ULL [static, protected]
const u64 ChessBoard::G4bit = 0x2000000ULL [static, protected]
const u64 ChessBoard::G5bit = 0x200000000ULL [static, protected]
const u64 ChessBoard::G7bit = 0x2000000000000ULL [static, protected]
const u64 ChessBoard::H1bit = 0x1ULL [static, protected]
const u64 ChessBoard::H1H2G1bit = 0x103ULL [static, protected]
const u64 ChessBoard::H2bit = 0x100ULL [static, protected]
const u64 ChessBoard::H2G2bit = 0x300ULL [static, protected]
const u64 ChessBoard::H3bit = 0x10000ULL [static, protected]
const u64 ChessBoard::H6bit = 0x10000000000ULL [static, protected]
const u64 ChessBoard::H7bit = 0x1000000000000ULL [static, protected]
const u64 ChessBoard::H7G7bit = 0x3000000000000ULL [static, protected]
const u64 ChessBoard::H8bit = 0x100000000000000ULL [static, protected]
const u64 ChessBoard::H8H7G8bit = 0x301000000000000ULL [static, protected]
const int ChessBoard::KING_BLACK = 8 [static]
const uchar ChessBoard::KING_SIDE_CASTLE_MOVE_MASK = 0b00000100 [static, protected]
const int ChessBoard::KING_WHITE = 9 [static]
const int ChessBoard::KNIGHT_BLACK = 6 [static]
const int ChessBoard::KNIGHT_WHITE = 7 [static]
const int ChessBoard::NO_ENPASSANT = -1 [static]
const int ChessBoard::PAWN_BLACK = 0 [static]
const int ChessBoard::PAWN_WHITE = 1 [static]
const int ChessBoard::QUEEN_BLACK = 10 [static]
const uchar ChessBoard::QUEEN_SIDE_CASTLE_MOVE_MASK = 0b00001000 [static, protected]
const int ChessBoard::QUEEN_WHITE = 11 [static]
const uchar ChessBoard::RIGHT_KING_CASTLE_BLACK_MASK = 0b01000000 [static, protected]
const uchar ChessBoard::RIGHT_KING_CASTLE_WHITE_MASK = 0b00010000 [static, protected]
const uchar ChessBoard::RIGHT_QUEEN_CASTLE_BLACK_MASK = 0b10000000 [static, protected]
const uchar ChessBoard::RIGHT_QUEEN_CASTLE_WHITE_MASK = 0b00100000 [static, protected]
const int ChessBoard::ROOK_BLACK = 2 [static]
const int ChessBoard::ROOK_WHITE = 3 [static]
bool ChessBoard::sideToMove [protected]
const int ChessBoard::SQUARE_FREE = 12 [static]
const u64 ChessBoard::WHITE_SQUARES = 0xAA55AA55AA55AA55ULL [static, protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines