From 153179b574dccd6df9c5c5f3e68f3c1725e26843 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 15 Jul 2013 12:26:45 +0200 Subject: Create the CommandBase class from Command The Handle() method is not part of CommandBase, making it possible to provide a different Handle() in each class derived from CommandBase --- src/command_parse.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 51358519b..d1ae98729 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -327,6 +327,10 @@ void CommandParser::RemoveCommand(Command* x) cmdlist.erase(n); } +CommandBase::~CommandBase() +{ +} + Command::~Command() { ServerInstance->Parser->RemoveCommand(this); @@ -357,7 +361,7 @@ CommandParser::CommandParser() { } -std::string CommandParser::TranslateUIDs(const std::vector& to, const std::vector& source, bool prefix_final, Command* custom_translator) +std::string CommandParser::TranslateUIDs(const std::vector& to, const std::vector& source, bool prefix_final, CommandBase* custom_translator) { std::vector::const_iterator types = to.begin(); std::string dest; @@ -386,7 +390,7 @@ std::string CommandParser::TranslateUIDs(const std::vector& to, c return dest; } -void CommandParser::TranslateSingleParam(TranslateType to, const std::string& item, std::string& dest, Command* custom_translator, unsigned int paramnumber) +void CommandParser::TranslateSingleParam(TranslateType to, const std::string& item, std::string& dest, CommandBase* custom_translator, unsigned int paramnumber) { switch (to) { -- cgit v1.3.1-10-gc9f91