aboutsummaryrefslogtreecommitdiff
path: root/src/wanda/command.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2022-09-16 21:36:12 +0200
committerFelix Morgner <felix.morgner@gmail.com>2022-09-16 21:36:12 +0200
commit64922e213ac731279cf3341253e67509adb2dfc8 (patch)
treeddcf4fd5b05ac426ecf032e43e8662c2f9ce0f57 /src/wanda/command.cpp
parentd22bc7b557d36da41fe88d3188a7cd335c3ccaa0 (diff)
downloadwanda-64922e213ac731279cf3341253e67509adb2dfc8.tar.xz
wanda-64922e213ac731279cf3341253e67509adb2dfc8.zip
wanda: restructure source directory
Diffstat (limited to 'src/wanda/command.cpp')
-rw-r--r--src/wanda/command.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/wanda/command.cpp b/src/wanda/command.cpp
deleted file mode 100644
index 960c52b..0000000
--- a/src/wanda/command.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <wanda/command.hpp>
-
-namespace wanda
-{
- std::optional<message> command::message() const
- {
- using namespace std::string_literals;
- auto const command = [this] {
- switch (id)
- {
- case command_id::change:
- return "CHANGE"s;
- default:
- return ""s;
- }
- }();
-
- auto argument_string = std::string{};
- for (int index = 0ul; index < arguments.size(); ++index)
- {
- argument_string += (index) ? "," + arguments[index] : arguments[index];
- }
-
- if (command.empty())
- {
- return std::nullopt;
- }
-
- return wanda::message{"C", command, argument_string};
- }
-
- std::optional<command> make_command(message message)
- {
- if (message.command == "CHANGE")
- {
- return {{command_id::change}};
- }
-
- return std::nullopt;
- }
-
- command make_change_command()
- {
- return {command_id::change};
- }
-
-} // namespace wanda \ No newline at end of file