2014-01-31 13:06:11 +01:00
|
|
|
#include "EventHandler.h"
|
|
|
|
|
|
|
|
using namespace Oyster::Event;
|
|
|
|
|
2014-01-31 15:38:12 +01:00
|
|
|
Oyster::Event::EventHandler EvtHandler;
|
2014-01-31 13:06:11 +01:00
|
|
|
|
|
|
|
EventHandler& EventHandler::Instance()
|
|
|
|
{
|
|
|
|
return EvtHandler;
|
|
|
|
}
|
|
|
|
|
|
|
|
EventHandler::EventHandler()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
EventHandler::~EventHandler()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void EventHandler::Update(InputClass* inputObject)
|
|
|
|
{
|
|
|
|
for(int i = 0; i < collections.size(); i++)
|
|
|
|
{
|
|
|
|
collections.at(i)->Update(inputObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-31 14:16:58 +01:00
|
|
|
void EventHandler::AddCollection(EventButtonCollection& collection)
|
2014-01-31 13:06:11 +01:00
|
|
|
{
|
2014-01-31 14:16:58 +01:00
|
|
|
collections.push_back(&collection);
|
2014-01-31 13:06:11 +01:00
|
|
|
}
|
|
|
|
|
2014-01-31 14:16:58 +01:00
|
|
|
EventButtonCollection& EventHandler::CreateCollection()
|
2014-01-31 13:06:11 +01:00
|
|
|
{
|
2014-01-31 15:38:12 +01:00
|
|
|
EventButtonCollection temp;
|
|
|
|
collections.push_back(&temp);
|
|
|
|
return temp;
|
2014-01-31 13:06:11 +01:00
|
|
|
}
|