mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-10 13:12:56 +00:00
Computation from last turn might have produced some nodes that are still accurate. Keeping them should make the engine a bit smarter.
31 lines
749 B
C++
31 lines
749 B
C++
/*
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "MCTSTree.h"
|
|
#include <LibChess/Chess.h>
|
|
#include <LibChess/UCIEndpoint.h>
|
|
|
|
class ChessEngine : public Chess::UCI::Endpoint {
|
|
C_OBJECT(ChessEngine)
|
|
public:
|
|
virtual ~ChessEngine() override = default;
|
|
|
|
virtual void handle_uci() override;
|
|
virtual void handle_position(Chess::UCI::PositionCommand const&) override;
|
|
virtual void handle_go(Chess::UCI::GoCommand const&) override;
|
|
|
|
private:
|
|
ChessEngine() = default;
|
|
ChessEngine(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out)
|
|
: Endpoint(in, out)
|
|
{
|
|
}
|
|
|
|
Chess::Board m_board;
|
|
Optional<MCTSTree> m_last_tree;
|
|
};
|