t7x/src/client/component/command.hpp

29 lines
544 B
C++
Raw Normal View History

2022-12-30 13:17:36 -05:00
#pragma once
namespace command
{
class params
{
public:
params();
int size() const;
const char* get(int index) const;
std::string join(int index) const;
const char* operator[](const int index) const
{
return this->get(index); //
}
private:
int nesting_;
};
using command_function = std::function<void()>;
using command_param_function = std::function<void(const params&)>;
2023-01-02 09:18:37 -05:00
void add(const std::string& command, command_function function);
void add(const std::string& command, command_param_function function);
2022-12-30 13:17:36 -05:00
}