Skip to content

Commit

Permalink
fix(citcore/console/CommandHelpers): correct issues from git push
Browse files Browse the repository at this point in the history
for some reason, pushing this change did some weird formatting
  • Loading branch information
Mycroft-Studios committed Dec 17, 2024
1 parent aab3340 commit f557f67
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions code/client/citicore/console/Console.CommandHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,33 @@ class ConsoleCommand
{
private:
int m_token;
std::string m_resource = "internal";
ConsoleCommandManager* m_manager;

public:
template<typename TFunction>
template <typename TFunction>
ConsoleCommand(const std::string& name, TFunction function)
: ConsoleCommand(ConsoleCommandManager::GetDefaultInstance(), name, function)
: ConsoleCommand(ConsoleCommandManager::GetDefaultInstance(), name, function)
{
}

template<typename TFunction>
template <typename TFunction>
ConsoleCommand(console::Context* context, const std::string& name, TFunction function)
: ConsoleCommand(context->GetCommandManager(), name, function)
: ConsoleCommand(context->GetCommandManager(), name, function)
{
}

template<typename TFunction>
template <typename TFunction>
ConsoleCommand(ConsoleCommandManager* manager, const std::string& name, TFunction function)
: m_manager(manager)
: m_manager(manager)
{
auto functionRef = detail::make_function(function);

using ConsoleCommandFunction = internal::ConsoleCommandFunction<decltype(functionRef)>;

m_token = m_manager->Register(
name, [=](ConsoleExecutionContext& context)
{
m_token = m_manager->Register(name, m_resource, [=](ConsoleExecutionContext& context) {
return ConsoleCommandFunction::Call(functionRef, context);
},
ConsoleCommandFunction::kNumArguments);
}, ConsoleCommandFunction::kNumArguments);
}

~ConsoleCommand()
Expand Down

0 comments on commit f557f67

Please sign in to comment.