[ServerCommands] Use slot wrapper
This commit is contained in:
parent
c8f80ceee0
commit
cea36c5630
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
std::unordered_map<std::int32_t, std::function<bool(Command::Params*)>> ServerCommands::Commands;
|
std::unordered_map<std::int32_t, Utils::Slot<bool(Command::Params*)>> ServerCommands::Commands;
|
||||||
|
|
||||||
void ServerCommands::OnCommand(std::int32_t cmd, std::function<bool(Command::Params*)> cb)
|
void ServerCommands::OnCommand(std::int32_t cmd, Utils::Slot<bool(Command::Params*)> cb)
|
||||||
{
|
{
|
||||||
ServerCommands::Commands[cmd] = cb;
|
ServerCommands::Commands[cmd] = cb;
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,10 @@ namespace Components
|
|||||||
ServerCommands();
|
ServerCommands();
|
||||||
~ServerCommands();
|
~ServerCommands();
|
||||||
|
|
||||||
static void OnCommand(std::int32_t cmd, std::function<bool(Command::Params*)> cb);
|
static void OnCommand(std::int32_t cmd, Utils::Slot<bool(Command::Params*)> cb);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::unordered_map<std::int32_t, std::function<bool(Command::Params*)>> Commands;
|
static std::unordered_map<std::int32_t, Utils::Slot<bool(Command::Params*)>> Commands;
|
||||||
|
|
||||||
static bool OnServerCommand();
|
static bool OnServerCommand();
|
||||||
static void OnServerCommandStub();
|
static void OnServerCommandStub();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user