1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

Chess: Add support for UCI engines

This commit is contained in:
Peter Elliott 2020-08-19 17:53:50 -06:00 committed by Andreas Kling
parent 7331b2b2f6
commit fb62eed058
8 changed files with 202 additions and 2 deletions

View file

@ -385,10 +385,13 @@ bool Board::apply_illegal_move(const Move& move, Colour colour)
{
Board clone = *this;
clone.m_previous_states = {};
clone.m_moves = {};
auto state_count = 0;
if (m_previous_states.contains(clone))
state_count = m_previous_states.get(clone).value();
m_previous_states.set(clone, state_count + 1);
m_moves.append(move);
m_turn = opposing_colour(colour);