![]() |
Cinnamon
1.1
chess engine
|
#include <GenMoves.h>
Public Member Functions | |
GenMoves () | |
virtual | ~GenMoves () |
void | setPerft (const bool b) |
bool | generateCaptures (const int side, u64, u64) |
void | generateMoves (const int side, const u64) |
template<int side> | |
bool | generateCaptures (const u64, const u64) |
template<int side> | |
void | generateMoves (const u64) |
int | getMoveFromSan (const string fenStr, _Tmove *move) |
void | init () |
virtual int | loadFen () |
virtual int | loadFen (string fen) |
void | makemove (_Tmove *move) |
void | setRepetitionMapCount (int i) |
bool | performKingShiftCapture (int side, const u64 enemies) |
bool | performKnightShiftCapture (const int piece, const u64 enemies, const int side) |
bool | performDiagCapture (const int piece, const u64 enemies, const int side, const u64 allpieces) |
bool | performRankFileCapture (const int piece, const u64 enemies, const int side, const u64 allpieces) |
template<int side> | |
bool | performPawnCapture (const u64 enemies) |
template<int side> | |
void | performPawnShift (const u64 xallpieces) |
int | performPawnShiftCount (int side, const u64 xallpieces) |
void | performDiagShift (const int piece, const int side, const u64 allpieces) |
void | performRankFileShift (const int piece, const int side, const u64 allpieces) |
bool | makemove (_Tmove *move, bool rep, bool) |
bool | isPinned (const int side, const uchar Position, const uchar piece) |
void | incListId () |
void | decListId () |
int | getListSize () |
void | pushStackMove () |
_Tmove * | getMove (int i) |
void | resetList () |
Static Public Attributes | |
static const int | MAX_PLY = 72 |
Protected Member Functions | |
_Tmove * | getNextMove (decltype(gen_list)) |
u64 | getKingAttackers (const int xside, u64, int) |
void | clearKillerHeuristic () |
u64 | getTotMoves () |
int | getMobilityBishop (int, u64, u64) |
int | getMobilityRook (const int position, const u64 enemies, const u64 friends) |
int | getMobilityPawns (const int side, const int ep, const u64 ped_friends, const u64 enemies, const u64 xallpieces) |
int | getMobilityCastle (const int side, const u64 allpieces) |
int | getMobilityQueen (const int position, const u64 enemies, const u64 friends) |
template<int side> | |
bool | attackSquare (const uchar Position, u64) |
void | initKillerHeuristic () |
void | pushRepetition (u64) |
template<int side> | |
bool | inCheckPerft (const int from, const int to, const uchar type, const int pieceFrom, const int pieceTo, int promotionPiece) |
void | performCastle (const int side, const uchar type) |
void | unPerformCastle (const int side, const uchar type) |
void | tryAllCastle (const int side, const u64 allpieces) |
void | takeback (_Tmove *move, const u64 oldkey, bool rep) |
template<uchar type> | |
bool | pushmove (const int from, const int to, const int side, int promotionPiece, int pieceFrom) |
template<int side> | |
bool | inCheck () |
template<int side> | |
bool | attackSquare (const uchar position) |
void | setKillerHeuristic (const int from, const int to, const int value) |
void | incKillerHeuristic (const int from, const int to, const int value) |
Protected Attributes | |
int | repetitionMapCount |
u64 * | repetitionMap |
int | currentPly |
bool | perftMode |
u64 | numMoves |
u64 | numMovesq |
int | listId |
_TmoveP * | gen_list |
int | killerHeuristic [64][64] |
Static Protected Attributes | |
static const u64 | RANK_1 = 0xff00ULL |
static const u64 | RANK_3 = 0xff000000ULL |
static const u64 | RANK_4 = 0xff00000000ULL |
static const u64 | RANK_6 = 0xff000000000000ULL |
static const uchar | STANDARD_MOVE_MASK = 0b00000011 |
static const uchar | ENPASSANT_MOVE_MASK = 0b00000001 |
static const uchar | PROMOTION_MOVE_MASK = 0b00000010 |
static const int | MAX_REP_COUNT = 1024 |
GenMoves::~GenMoves | ( | ) | [virtual] |
bool GenMoves::attackSquare | ( | const uchar | Position, |
u64 | allpieces | ||
) | [protected] |
LEFT
RIGHT
bool GenMoves::attackSquare | ( | const uchar | position | ) | [inline, protected] |
void GenMoves::clearKillerHeuristic | ( | ) | [protected] |
void GenMoves::decListId | ( | ) | [inline] |
bool GenMoves::generateCaptures | ( | const int | side, |
u64 | enemies, | ||
u64 | friends | ||
) |
bool GenMoves::generateCaptures | ( | const u64 | enemies, |
const u64 | friends | ||
) |
void GenMoves::generateMoves | ( | const int | side, |
const u64 | allpieces | ||
) |
void GenMoves::generateMoves | ( | const u64 | allpieces | ) |
u64 GenMoves::getKingAttackers | ( | const int | xside, |
u64 | allpieces, | ||
int | position | ||
) | [protected] |
knight
king
pawn
bishop queen
LEFT
RIGHT
rook queen
int GenMoves::getListSize | ( | ) | [inline] |
int GenMoves::getMobilityBishop | ( | int | position, |
u64 | enemies, | ||
u64 | friends | ||
) | [protected] |
int GenMoves::getMobilityCastle | ( | const int | side, |
const u64 | allpieces | ||
) | [protected] |
int GenMoves::getMobilityPawns | ( | const int | side, |
const int | ep, | ||
const u64 | ped_friends, | ||
const u64 | enemies, | ||
const u64 | xallpieces | ||
) | [protected] |
int GenMoves::getMobilityQueen | ( | const int | position, |
const u64 | enemies, | ||
const u64 | friends | ||
) | [protected] |
int GenMoves::getMobilityRook | ( | const int | position, |
const u64 | enemies, | ||
const u64 | friends | ||
) | [protected] |
_Tmove* GenMoves::getMove | ( | int | i | ) | [inline] |
int GenMoves::getMoveFromSan | ( | const string | fenStr, |
_Tmove * | move | ||
) |
_Tmove * GenMoves::getNextMove | ( | decltype(gen_list) | ) | [protected] |
u64 GenMoves::getTotMoves | ( | ) | [protected] |
bool GenMoves::inCheck | ( | ) | [inline, protected] |
bool GenMoves::inCheckPerft | ( | const int | from, |
const int | to, | ||
const uchar | type, | ||
const int | pieceFrom, | ||
const int | pieceTo, | ||
int | promotionPiece | ||
) | [protected] |
void GenMoves::incKillerHeuristic | ( | const int | from, |
const int | to, | ||
const int | value | ||
) | [inline, protected] |
void GenMoves::incListId | ( | ) | [inline] |
void GenMoves::init | ( | ) |
void GenMoves::initKillerHeuristic | ( | ) | [protected] |
bool GenMoves::isPinned | ( | const int | side, |
const uchar | Position, | ||
const uchar | piece | ||
) |
int GenMoves::loadFen | ( | ) | [virtual] |
Reimplemented from ChessBoard.
int GenMoves::loadFen | ( | string | fen | ) | [virtual] |
Reimplemented from ChessBoard.
void GenMoves::makemove | ( | _Tmove * | move | ) |
bool GenMoves::makemove | ( | _Tmove * | move, |
bool | rep, | ||
bool | checkInCheck | ||
) |
void GenMoves::performCastle | ( | const int | side, |
const uchar | type | ||
) | [protected] |
bool GenMoves::performDiagCapture | ( | const int | piece, |
const u64 | enemies, | ||
const int | side, | ||
const u64 | allpieces | ||
) |
LEFT
RIGHT
void GenMoves::performDiagShift | ( | const int | piece, |
const int | side, | ||
const u64 | allpieces | ||
) |
LEFT
RIGHT
bool GenMoves::performKingShiftCapture | ( | int | side, |
const u64 | enemies | ||
) |
bool GenMoves::performKnightShiftCapture | ( | const int | piece, |
const u64 | enemies, | ||
const int | side | ||
) |
bool GenMoves::performPawnCapture | ( | const u64 | enemies | ) |
void GenMoves::performPawnShift | ( | const u64 | xallpieces | ) |
int GenMoves::performPawnShiftCount | ( | int | side, |
const u64 | xallpieces | ||
) |
bool GenMoves::performRankFileCapture | ( | const int | piece, |
const u64 | enemies, | ||
const int | side, | ||
const u64 | allpieces | ||
) |
void GenMoves::performRankFileShift | ( | const int | piece, |
const int | side, | ||
const u64 | allpieces | ||
) |
FILE
RANK
bool GenMoves::pushmove | ( | const int | from, |
const int | to, | ||
const int | side, | ||
int | promotionPiece, | ||
int | pieceFrom | ||
) | [protected] |
void GenMoves::pushRepetition | ( | u64 | ) | [protected] |
void GenMoves::pushStackMove | ( | ) | [inline] |
void GenMoves::resetList | ( | ) | [inline] |
void GenMoves::setKillerHeuristic | ( | const int | from, |
const int | to, | ||
const int | value | ||
) | [inline, protected] |
void GenMoves::setPerft | ( | const bool | b | ) |
void GenMoves::setRepetitionMapCount | ( | int | i | ) |
void GenMoves::takeback | ( | _Tmove * | move, |
const u64 | oldkey, | ||
bool | rep | ||
) | [protected] |
void GenMoves::tryAllCastle | ( | const int | side, |
const u64 | allpieces | ||
) | [protected] |
void GenMoves::unPerformCastle | ( | const int | side, |
const uchar | type | ||
) | [protected] |
int GenMoves::currentPly [protected] |
const uchar GenMoves::ENPASSANT_MOVE_MASK = 0b00000001 [static, protected] |
_TmoveP* GenMoves::gen_list [protected] |
int GenMoves::killerHeuristic[64][64] [protected] |
int GenMoves::listId [protected] |
const int GenMoves::MAX_PLY = 72 [static] |
const int GenMoves::MAX_REP_COUNT = 1024 [static, protected] |
u64 GenMoves::numMoves [protected] |
u64 GenMoves::numMovesq [protected] |
bool GenMoves::perftMode [protected] |
const uchar GenMoves::PROMOTION_MOVE_MASK = 0b00000010 [static, protected] |
const u64 GenMoves::RANK_1 = 0xff00ULL [static, protected] |
const u64 GenMoves::RANK_3 = 0xff000000ULL [static, protected] |
const u64 GenMoves::RANK_4 = 0xff00000000ULL [static, protected] |
const u64 GenMoves::RANK_6 = 0xff000000000000ULL [static, protected] |
u64* GenMoves::repetitionMap [protected] |
int GenMoves::repetitionMapCount [protected] |
const uchar GenMoves::STANDARD_MOVE_MASK = 0b00000011 [static, protected] |