mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 16:45:07 +00:00

Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
29 lines
677 B
C++
29 lines
677 B
C++
/*
|
|
* 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 { }
|
|
|
|
virtual void handle_uci() override;
|
|
virtual void handle_position(const Chess::UCI::PositionCommand&) override;
|
|
virtual void handle_go(const Chess::UCI::GoCommand&) override;
|
|
|
|
private:
|
|
ChessEngine() { }
|
|
ChessEngine(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out)
|
|
: Endpoint(in, out)
|
|
{
|
|
}
|
|
|
|
Chess::Board m_board;
|
|
};
|