diff options
| author | Adam <adammegarules1@gmail.com> | 2026-08-21 18:35:02 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-08-21 18:35:02 +0200 |
| commit | 05035f72d77a18321d39e118ed28858b8c25bdad (patch) | |
| tree | 64b8502b89907bbb0662a30625e762739efd9031 /src/board | |
| parent | e4a8a445acd8f966861174ec5d6e2537f060dc1a (diff) | |
refactor(search): making code nicer and little faster
Diffstat (limited to 'src/board')
| -rw-r--r-- | src/board/board.cpp | 8 | ||||
| -rw-r--r-- | src/board/board.hpp | 2 |
2 files changed, 0 insertions, 10 deletions
diff --git a/src/board/board.cpp b/src/board/board.cpp index 7084c9d..48d0975 100644 --- a/src/board/board.cpp +++ b/src/board/board.cpp @@ -169,8 +169,6 @@ Undo MakeMove(uint16_t move, Game *g) { undo.oldHalfMoveClock = g->halfMoveClock; undo.oldMoveClock = g->MoveClock; - undo.oldState = g->state; - undo.OldWhiteCastleKing = g->whiteCastleKing; undo.OldWhiteCastleQueen = g->whiteCastleQueen; undo.OldBlackCastleKing = g->blackCastleKing; @@ -196,10 +194,6 @@ Undo MakeMove(uint16_t move, Game *g) { g->halfMoveClock = 0; } - if (g->halfMoveClock >= 100) { - g->state = DRAW; - } - // Playing enpasstant xorEnpassantKey(g); // remove existing key @@ -408,8 +402,6 @@ void UndoMove(Undo undo, Game *g) { g->halfMoveClock = undo.oldHalfMoveClock; g->MoveClock = undo.oldMoveClock; - g->state = undo.oldState; - g->whiteCastleKing = undo.OldWhiteCastleKing; g->whiteCastleQueen = undo.OldWhiteCastleQueen; g->blackCastleKing = undo.OldBlackCastleKing; diff --git a/src/board/board.hpp b/src/board/board.hpp index f9947ed..1b3ded1 100644 --- a/src/board/board.hpp +++ b/src/board/board.hpp @@ -67,7 +67,6 @@ struct Game { int MoveClock = 0; Position enPassant; bool canEnpassant = false; - GameState state = TURN; uint64_t hash = 0; std::vector<uint64_t> history; std::unordered_map<uint64_t, TranspositionsEntry> *Transpositions = nullptr; @@ -98,7 +97,6 @@ struct Undo { int oldHalfMoveClock; int oldMoveClock; uint64_t Hash; - GameState oldState; // castling bool wasCastle = false; |
