Initial repository 1.0.0

This commit is contained in:
Brad Arant committed 2019-02-07 13:28:21 -08:00
commit d8b1275884
1861 files changed
+66342

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
#include "CommandList.h"
namespace core {
CommandList::CommandList() {}
CommandList::~CommandList() {}
void CommandList::add(Command &command, std::string name) {
command.setName(name);
commands.push_back(&command);
}
void CommandList::remove(Command &command) {
}
bool CommandList::processRequest(std::string request, Session *session) {
bool found = false;
for(auto *command : commands) {
if(command->check(request)) {
command->processCommand(request, session);
found = true;
break;
}
}
return found;
}
int CommandList::processCommand(std::string request, Session *session) {
for(Command *command : commands)
session->out << command->getName() << std::endl;
}
}