![]() |
Cinnamon
1.0
chess engine
|
#include <GenMoves.h>
Public Member Functions | |
GenMoves () | |
virtual | ~GenMoves () |
void | setPerft (bool b) |
bool | generateCaptures (const int side, u64, u64, u64 *key) |
void | generateMoves (const int side, u64) |
template<int side> | |
bool | generateCaptures (u64, u64, u64 *key) |
template<int side> | |
void | generateMoves (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 | performBishopCapture (const int piece, const u64 enemies, const int side, const u64 allpieces) |
bool | performRookQueenCapture (const int piece, const u64 enemies, const int side, const u64 allpieces) |
template<int side> | |
bool | performPawnCapture (const u64 enemies, u64 *key) |
template<int side> | |
void | performPawnShift (const u64 xallpieces) |
void | performBishopShift (const int piece, const int side, const u64 allpieces) |
void | performRookQueenShift (const int piece, const int side, const u64 allpieces) |
void | incListId () |
void | decListId () |
int | getListCount () |
void | pushStackMove () |
_Tmove * | getMove (int i) |
void | resetList () |
void | makemove (_Tmove *move, u64 *key, bool rep) |
bool | isPinned (const int side, const uchar Position, const uchar piece) |
Static Public Attributes | |
static const int | MAX_PLY = 64 |
Protected Member Functions | |
_Tmove * | getNextMove (_TmoveP *) |
u64 | getKingAttackers (const int side) |
void | clearKillerHeuristic () |
u64 | getTotMoves () |
template<int side> | |
bool | attackSquare (const uchar Position) |
void | initKillerHeuristic () |
void | pushRepetition (u64) |
template<int side> | |
bool | inCheck (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, u64 *key) |
void | unPerformCastle (const int side, const uchar type) |
void | tryAllCastle (const int side, const u64 allpieces) |
void | setKillerHeuristic (int from, int to, int value) |
void | incKillerHeuristic (int from, int to, int value) |
void | takeback (_Tmove *move, u64 *key, 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 () |
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 = 512 |
Definition at line 6 of file GenMoves.h.
Definition at line 3 of file GenMoves.cpp.
GenMoves::~GenMoves | ( | ) | [virtual] |
Definition at line 110 of file GenMoves.cpp.
bool GenMoves::attackSquare | ( | const uchar | Position | ) | [protected] |
Definition at line 657 of file GenMoves.cpp.
void GenMoves::clearKillerHeuristic | ( | ) | [protected] |
Definition at line 83 of file GenMoves.cpp.
void GenMoves::decListId | ( | ) | [inline] |
Definition at line 37 of file GenMoves.h.
bool GenMoves::generateCaptures | ( | const int | side, |
u64 | enemies, | ||
u64 | friends, | ||
u64 * | key | ||
) |
Definition at line 36 of file GenMoves.cpp.
bool GenMoves::generateCaptures | ( | u64 | enemies, |
u64 | friends, | ||
u64 * | key | ||
) |
Definition at line 41 of file GenMoves.cpp.
void GenMoves::generateMoves | ( | const int | side, |
u64 | allpieces | ||
) |
Definition at line 18 of file GenMoves.cpp.
void GenMoves::generateMoves | ( | u64 | allpieces | ) |
Definition at line 23 of file GenMoves.cpp.
u64 GenMoves::getKingAttackers | ( | const int | side | ) | [protected] |
Definition at line 585 of file GenMoves.cpp.
int GenMoves::getListCount | ( | ) | [inline] |
Definition at line 41 of file GenMoves.h.
_Tmove* GenMoves::getMove | ( | int | i | ) | [inline] |
Definition at line 49 of file GenMoves.h.
int GenMoves::getMoveFromSan | ( | const string | fenStr, |
_Tmove * | move | ||
) |
Definition at line 1054 of file GenMoves.cpp.
_Tmove * GenMoves::getNextMove | ( | _TmoveP * | list | ) | [protected] |
Definition at line 87 of file GenMoves.cpp.
u64 GenMoves::getTotMoves | ( | ) | [protected] |
Definition at line 1033 of file GenMoves.cpp.
bool GenMoves::inCheck | ( | const int | from, |
const int | to, | ||
const uchar | type, | ||
const int | pieceFrom, | ||
const int | pieceTo, | ||
int | promotionPiece | ||
) | [protected] |
Definition at line 757 of file GenMoves.cpp.
bool GenMoves::inCheck | ( | ) | [inline, protected] |
Definition at line 97 of file GenMoves.h.
void GenMoves::incKillerHeuristic | ( | int | from, |
int | to, | ||
int | value | ||
) | [protected] |
Definition at line 73 of file GenMoves.cpp.
void GenMoves::incListId | ( | ) | [inline] |
Definition at line 32 of file GenMoves.h.
void GenMoves::init | ( | ) |
Definition at line 1020 of file GenMoves.cpp.
void GenMoves::initKillerHeuristic | ( | ) | [protected] |
bool GenMoves::isPinned | ( | const int | side, |
const uchar | Position, | ||
const uchar | piece | ||
) |
Definition at line 117 of file GenMoves.cpp.
int GenMoves::loadFen | ( | ) | [virtual] |
Reimplemented from ChessBoard.
Definition at line 1040 of file GenMoves.cpp.
int GenMoves::loadFen | ( | string | fen | ) | [virtual] |
Reimplemented from ChessBoard.
Definition at line 1044 of file GenMoves.cpp.
void GenMoves::makemove | ( | _Tmove * | move | ) |
Definition at line 1050 of file GenMoves.cpp.
void GenMoves::makemove | ( | _Tmove * | move, |
u64 * | key, | ||
bool | rep | ||
) |
Definition at line 915 of file GenMoves.cpp.
bool GenMoves::performBishopCapture | ( | const int | piece, |
const u64 | enemies, | ||
const int | side, | ||
const u64 | allpieces | ||
) |
Definition at line 388 of file GenMoves.cpp.
void GenMoves::performBishopShift | ( | const int | piece, |
const int | side, | ||
const u64 | allpieces | ||
) |
Definition at line 295 of file GenMoves.cpp.
void GenMoves::performCastle | ( | const int | side, |
const uchar | type, | ||
u64 * | key | ||
) | [protected] |
Definition at line 197 of file GenMoves.cpp.
bool GenMoves::performKingShiftCapture | ( | int | side, |
const u64 | enemies | ||
) |
Definition at line 445 of file GenMoves.cpp.
bool GenMoves::performKnightShiftCapture | ( | const int | piece, |
const u64 | enemies, | ||
const int | side | ||
) |
Definition at line 427 of file GenMoves.cpp.
bool GenMoves::performPawnCapture | ( | const u64 | enemies, |
u64 * | key | ||
) |
Definition at line 507 of file GenMoves.cpp.
void GenMoves::performPawnShift | ( | const u64 | xallpieces | ) |
Definition at line 476 of file GenMoves.cpp.
bool GenMoves::performRookQueenCapture | ( | const int | piece, |
const u64 | enemies, | ||
const int | side, | ||
const u64 | allpieces | ||
) |
Definition at line 352 of file GenMoves.cpp.
void GenMoves::performRookQueenShift | ( | const int | piece, |
const int | side, | ||
const u64 | allpieces | ||
) |
Definition at line 265 of file GenMoves.cpp.
bool GenMoves::pushmove | ( | const int | from, |
const int | to, | ||
const int | side, | ||
int | promotionPiece, | ||
int | pieceFrom | ||
) | [protected] |
Definition at line 858 of file GenMoves.cpp.
void GenMoves::pushRepetition | ( | u64 | ) | [protected] |
void GenMoves::pushStackMove | ( | ) | [inline] |
Definition at line 45 of file GenMoves.h.
void GenMoves::resetList | ( | ) | [inline] |
Definition at line 53 of file GenMoves.h.
void GenMoves::setKillerHeuristic | ( | int | from, |
int | to, | ||
int | value | ||
) | [protected] |
Definition at line 68 of file GenMoves.cpp.
void GenMoves::setPerft | ( | bool | b | ) |
Definition at line 79 of file GenMoves.cpp.
void GenMoves::setRepetitionMapCount | ( | int | i | ) |
Definition at line 1036 of file GenMoves.cpp.
void GenMoves::takeback | ( | _Tmove * | move, |
u64 * | key, | ||
const u64 | oldkey, | ||
bool | rep | ||
) | [protected] |
Definition at line 816 of file GenMoves.cpp.
void GenMoves::tryAllCastle | ( | const int | side, |
const u64 | allpieces | ||
) | [protected] |
Definition at line 330 of file GenMoves.cpp.
void GenMoves::unPerformCastle | ( | const int | side, |
const uchar | type | ||
) | [protected] |
Definition at line 733 of file GenMoves.cpp.
int GenMoves::currentPly [protected] |
Definition at line 70 of file GenMoves.h.
const uchar GenMoves::ENPASSANT_MOVE_MASK = 0b00000001 [static, protected] |
Definition at line 65 of file GenMoves.h.
_TmoveP* GenMoves::gen_list [protected] |
Definition at line 74 of file GenMoves.h.
int GenMoves::killerHeuristic[64][64] [protected] |
Definition at line 87 of file GenMoves.h.
int GenMoves::listId [protected] |
Definition at line 73 of file GenMoves.h.
const int GenMoves::MAX_PLY = 64 [static] |
Definition at line 11 of file GenMoves.h.
const int GenMoves::MAX_REP_COUNT = 512 [static, protected] |
Definition at line 67 of file GenMoves.h.
u64 GenMoves::numMoves [protected] |
Definition at line 72 of file GenMoves.h.
u64 GenMoves::numMovesq [protected] |
Definition at line 72 of file GenMoves.h.
bool GenMoves::perftMode [protected] |
Definition at line 71 of file GenMoves.h.
const uchar GenMoves::PROMOTION_MOVE_MASK = 0b00000010 [static, protected] |
Definition at line 66 of file GenMoves.h.
const u64 GenMoves::RANK_1 = 0xff00ULL [static, protected] |
Definition at line 60 of file GenMoves.h.
const u64 GenMoves::RANK_3 = 0xff000000ULL [static, protected] |
Definition at line 61 of file GenMoves.h.
const u64 GenMoves::RANK_4 = 0xff00000000ULL [static, protected] |
Definition at line 62 of file GenMoves.h.
const u64 GenMoves::RANK_6 = 0xff000000000000ULL [static, protected] |
Definition at line 63 of file GenMoves.h.
u64* GenMoves::repetitionMap [protected] |
Definition at line 69 of file GenMoves.h.
int GenMoves::repetitionMapCount [protected] |
Definition at line 68 of file GenMoves.h.
const uchar GenMoves::STANDARD_MOVE_MASK = 0b00000011 [static, protected] |
Definition at line 64 of file GenMoves.h.