summaryrefslogtreecommitdiff
path: root/Userland/Services/ChessEngine/ChessEngine.h
blob: 05e541c1f9a5aaf8b65f4d3abb6ecd42383a9a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2020, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibChess/Chess.h>
#include <LibChess/UCIEndpoint.h>

class ChessEngine : public Chess::UCI::Endpoint {
    C_OBJECT(ChessEngine)
public:
    virtual ~ChessEngine() override { }

    ChessEngine() { }
    ChessEngine(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out)
        : Endpoint(in, out)
    {
    }

    virtual void handle_uci() override;
    virtual void handle_position(const Chess::UCI::PositionCommand&) override;
    virtual void handle_go(const Chess::UCI::GoCommand&) override;

private:
    Chess::Board m_board;
};