From 9c3b76d6a0fd7a3d9ab60303d763af759c0ba4a7 Mon Sep 17 00:00:00 2001 From: rektdie Date: Thu, 20 Mar 2025 19:42:22 +0100 Subject: [PATCH] small refactor in board --- source/board.cpp | 6 ++---- source/board.h | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/board.cpp b/source/board.cpp index be515c8..ebb845c 100644 --- a/source/board.cpp +++ b/source/board.cpp @@ -6,10 +6,6 @@ #include #include "utils.h" -void Board::Init() { - SetByFen(StartingFen); -} - void Board::Reset() { castlingRights = 0; enPassantTarget = noEPTarget; @@ -20,6 +16,8 @@ void Board::Reset() { colors = std::array(); moveList = std::array(); + attackMaps = std::array, 2>(); + currentMoveIndex = 0; hashKey = 0ULL; diff --git a/source/board.h b/source/board.h index 3ef20c9..aeb9ee2 100644 --- a/source/board.h +++ b/source/board.h @@ -13,12 +13,13 @@ inline U64 positionHistory[1000]; class Board { public: Board() { - Init(); + SetByFen(StartingFen); } std::array pieces; std::array colors; - U64 attackMaps[2][64]; + std::array, 2> attackMaps; + //U64 attackMaps[2][64]; Bitboard occupied;