hlswmaster-ng/modulelist.cpp
2006-02-02 16:55:44 +01:00

43 lines
705 B
C++

#include "logging.h"
#include "modulelist.h"
ModuleList::ModuleList()
{
}
ModuleList::~ModuleList()
{
while (!mlist.isEmpty())
delete mlist.get();
}
void ModuleList::reg(Module* mod)
{
LogSystem::log(LOG_INFO, "Loading Module '%s'", mod->getName());
mlist.addTail(mod);
}
void ModuleList::scan(MultiSock* msock)
{
Iterator<Module> *it = mlist.createIterator();
while (it->hasNext())
it->next()->scan(msock);
delete it;
}
int ModuleList::parse(NetPkt* pkt, GameList* slist)
{
int retval = PKT_REJECT;
Iterator<Module> *it = mlist.createIterator();
while (it->hasNext()) {
retval = it->next()->parse(pkt, slist);
if (retval != PKT_REJECT)
break;
}
delete it;
return retval;
}