From 0c1d1a0f24655c22a373c19aac90a6a225a353e6 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 8 Dec 2018 10:43:50 +0100 Subject: wanda: reformat source code --- src/command.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'src/command.cpp') diff --git a/src/command.cpp b/src/command.cpp index 6831d5e..76cdee7 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -2,47 +2,46 @@ namespace wanda { - -std::optional command::message() const -{ + std::optional command::message() const + { using namespace std::string_literals; auto const command = [this] { - switch (id) - { + switch (id) + { case command_id::change: - return "CHANGE"s; + return "CHANGE"s; default: - return ""s; - } + return ""s; + } }(); auto argument_string = std::string{}; for (int index = 0ul; index < arguments.size(); ++index) { - argument_string += (index) ? "," + arguments[index] : arguments[index]; + argument_string += (index) ? "," + arguments[index] : arguments[index]; } if (command.empty()) { - return std::nullopt; + return std::nullopt; } return wanda::message{"C", command, argument_string}; -} + } -std::optional make_command(message message) -{ - if(message.command == "CHANGE") + std::optional make_command(message message) + { + if (message.command == "CHANGE") { - return {{command_id::change}}; + return {{command_id::change}}; } return std::nullopt; -} + } -command make_change_command() -{ + command make_change_command() + { return {command_id::change}; -} + } -} // namespace wanda \ No newline at end of file +} // namespace wanda \ No newline at end of file -- cgit v1.2.3