diff options
| author | alpine <[email protected]> | 2020-06-24 13:05:48 +0200 |
|---|---|---|
| committer | alpine <[email protected]> | 2020-06-24 13:05:48 +0200 |
| commit | 8f0130c8f74482a7d54f9bfb8763f4c6d705765c (patch) | |
| tree | e9090817a498da9ae18a58adee92f4f8ba2db03b /server/src/util/commands.h | |
| parent | Changed clang format style. (diff) | |
| download | loader-8f0130c8f74482a7d54f9bfb8763f4c6d705765c.tar.xz loader-8f0130c8f74482a7d54f9bfb8763f4c6d705765c.zip | |
Added client version control.
Reverted back to google formatting.
Diffstat (limited to 'server/src/util/commands.h')
| -rw-r--r-- | server/src/util/commands.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/server/src/util/commands.h b/server/src/util/commands.h index 547a78c..3648df2 100644 --- a/server/src/util/commands.h +++ b/server/src/util/commands.h @@ -1,19 +1,18 @@ #pragma once class commands { - using func = std::function<void()>; - std::unordered_map<std::string_view, func> m_cmds; + using func = std::function<void()>; + std::unordered_map<std::string_view, func> m_cmds; -public: - bool parse_input(const std::string_view str) - { - auto it = m_cmds.find(str); - if(it != m_cmds.end()) { - it->second(); - return true; - } - return false; + public: + bool parse_input(const std::string_view str) { + auto it = m_cmds.find(str); + if (it != m_cmds.end()) { + it->second(); + return true; } + return false; + } - void add(const std::string_view cmd, const func& cb) { m_cmds[cmd] = cb; } + void add(const std::string_view cmd, const func& cb) { m_cmds[cmd] = cb; } }; |