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

LibChess: Change UCI::Command::Type to enum class

This commit is contained in:
Lenny Maiorani 2022-03-18 11:29:14 -06:00 committed by Linus Groh
parent 0eaed09517
commit 35af46ee62
2 changed files with 3 additions and 3 deletions

View file

@ -15,7 +15,7 @@ namespace Chess::UCI {
class Command : public Core::Event { class Command : public Core::Event {
public: public:
enum Type { enum class Type {
// GUI to engine commands. // GUI to engine commands.
UCI = 12000, UCI = 12000,
Debug, Debug,
@ -40,7 +40,7 @@ public:
}; };
explicit Command(Type type) explicit Command(Type type)
: Core::Event(type) : Core::Event(to_underlying(type))
{ {
} }

View file

@ -29,7 +29,7 @@ void Endpoint::send_command(Command const& command)
void Endpoint::event(Core::Event& event) void Endpoint::event(Core::Event& event)
{ {
switch (event.type()) { switch (static_cast<Command::Type>(event.type())) {
case Command::Type::UCI: case Command::Type::UCI:
return handle_uci(); return handle_uci();
case Command::Type::Debug: case Command::Type::Debug: