43 void clear() noexcept { scores = { }; }
51 for (
auto& color : scores)
52 for (
auto& from : color)
53 std::ranges::transform(from, from.begin(), [](
const int score) { return score / 2; });
60 void update(
const bool whiteToMove,
const Move move,
const int bonus)
noexcept
66 [[nodiscard]]
auto get(
const bool whiteToMove,
const Move move)
const noexcept ->
int
68 return scores[whiteToMove ? 1uz : 0uz][move.from().index()][move.to().index()];
72 [[nodiscard]]
auto get_ref(
const bool whiteToMove,
const Move move)
noexcept ->
int&
74 return scores[whiteToMove ? 1uz : 0uz][move.from().index()][move.to().index()];
77 using Table = std::array<std::array<int, 64uz>, 64uz>;
79 std::array<Table, 2uz> scores { };
void update(const bool whiteToMove, const Move move, const int bonus) noexcept
auto get(const bool whiteToMove, const Move move) const noexcept -> int
static constexpr auto MAX_SCORE