| 149 | } |
| 150 | |
| 151 | bool UnregisterCommand(std::string_view name) |
| 152 | { |
| 153 | std::lock_guard<std::mutex> lock(m_Mutex); |
| 154 | if (auto it = m_Dictionary.find(name); it != m_Dictionary.end()) |
| 155 | { |
| 156 | if (it->second->AsCommand()) |
| 157 | { |
| 158 | m_Dictionary.erase(it); |
| 159 | return true; |
| 160 | } |
| 161 | else |
| 162 | donut::log::error("unregister command '%s'; object is not a console command"); |
| 163 | } |
| 164 | else |
| 165 | donut::log::error("unregister command '%s'; command does not exist", name); |
| 166 | return false; |
| 167 | } |
| 168 | |
| 169 | template <typename T> Object* RegisterVariable(char const* name, char const* description, T const& value, VariableState state) |
| 170 | { |
no test coverage detected