From 35af46ee627ab1d05350717b516691402b6e4f40 Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Fri, 18 Mar 2022 11:29:14 -0600 Subject: [PATCH] LibChess: Change UCI::Command::Type to enum class --- Userland/Libraries/LibChess/UCICommand.h | 4 ++-- Userland/Libraries/LibChess/UCIEndpoint.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibChess/UCICommand.h b/Userland/Libraries/LibChess/UCICommand.h index 0b5ae607cb..80a9980566 100644 --- a/Userland/Libraries/LibChess/UCICommand.h +++ b/Userland/Libraries/LibChess/UCICommand.h @@ -15,7 +15,7 @@ namespace Chess::UCI { class Command : public Core::Event { public: - enum Type { + enum class Type { // GUI to engine commands. UCI = 12000, Debug, @@ -40,7 +40,7 @@ public: }; explicit Command(Type type) - : Core::Event(type) + : Core::Event(to_underlying(type)) { } diff --git a/Userland/Libraries/LibChess/UCIEndpoint.cpp b/Userland/Libraries/LibChess/UCIEndpoint.cpp index 0c8723b9db..6c107a101c 100644 --- a/Userland/Libraries/LibChess/UCIEndpoint.cpp +++ b/Userland/Libraries/LibChess/UCIEndpoint.cpp @@ -29,7 +29,7 @@ void Endpoint::send_command(Command const& command) void Endpoint::event(Core::Event& event) { - switch (event.type()) { + switch (static_cast(event.type())) { case Command::Type::UCI: return handle_uci(); case Command::Type::Debug: