summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@serenityos.org>2022-03-18 11:29:14 -0600
committerLinus Groh <mail@linusgroh.de>2022-04-03 17:36:48 +0100
commit35af46ee627ab1d05350717b516691402b6e4f40 (patch)
treedef0048c760787df95e31d39157863ce9f651812 /Userland
parent0eaed09517efd9731cc81a90e9e7fb6440d1e974 (diff)
downloadserenity-35af46ee627ab1d05350717b516691402b6e4f40.zip
LibChess: Change UCI::Command::Type to enum class
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibChess/UCICommand.h4
-rw-r--r--Userland/Libraries/LibChess/UCIEndpoint.cpp2
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<Command::Type>(event.type())) {
case Command::Type::UCI:
return handle_uci();
case Command::Type::Debug: