diff options
Diffstat (limited to 'source/lib/proto/src/command.cpp')
| -rw-r--r-- | source/lib/proto/src/command.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/source/lib/proto/src/command.cpp b/source/lib/proto/src/command.cpp deleted file mode 100644 index 5a669f5..0000000 --- a/source/lib/proto/src/command.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "wanda/proto/command.hpp" - -namespace wanda::proto -{ - 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::proto::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::proto
\ No newline at end of file |
