4jcraft/targets/minecraft/commands/CommandDispatcher.h
2026-04-01 18:17:44 -05:00

25 lines
559 B
C++

#pragma once
#include <stdint.h>
#include <format>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "minecraft/commands/CommandsEnum.h"
class Command;
class CommandSender;
class CommandDispatcher {
private:
std::unordered_map<EGameCommand, Command*> commandsById;
std::unordered_set<Command*> commands;
public:
int performCommand(std::shared_ptr<CommandSender> sender,
EGameCommand command, std::vector<uint8_t>& commandData);
Command* addCommand(Command* command);
};