aboutsummaryrefslogtreecommitdiff
path: root/server/src/util/commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/util/commands.h')
-rw-r--r--server/src/util/commands.h23
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; }
};