2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class Command;
|
|
|
|
|
class CommandSender;
|
|
|
|
|
|
|
|
|
|
class CommandDispatcher
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
#ifdef __ORBIS__
|
|
|
|
|
unordered_map<EGameCommand, Command *,std::hash<int>> commandsById;
|
|
|
|
|
#else
|
|
|
|
|
unordered_map<EGameCommand, Command *> commandsById;
|
|
|
|
|
#endif
|
|
|
|
|
unordered_set<Command *> commands;
|
|
|
|
|
|
|
|
|
|
public:
|
2026-03-03 03:04:10 +08:00
|
|
|
int performCommand(shared_ptr<CommandSender> sender, EGameCommand command, byteArray commandData);
|
2026-03-01 12:16:08 +08:00
|
|
|
Command *addCommand(Command *command);
|
|
|
|
|
};
|