2014-01-31 13:06:11 +01:00
|
|
|
#include "EventButtonCollection.h"
|
|
|
|
|
|
|
|
using namespace Oyster::Event;
|
|
|
|
|
2014-01-31 14:16:58 +01:00
|
|
|
EventButtonCollection::EventButtonCollection()
|
|
|
|
: collectionState(EventCollectionState_Enabled)
|
2014-01-31 13:06:11 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
EventButtonCollection::~EventButtonCollection()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void EventButtonCollection::Update(InputClass* inputObject)
|
|
|
|
{
|
2014-01-31 14:16:58 +01:00
|
|
|
if(this->collectionState == EventCollectionState_Enabled)
|
2014-01-31 13:06:11 +01:00
|
|
|
{
|
2014-01-31 14:16:58 +01:00
|
|
|
for(int i = 0; i < buttons.size(); i++)
|
|
|
|
{
|
|
|
|
buttons.at(i)->CheckCollision(inputObject);
|
|
|
|
}
|
2014-01-31 13:06:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-31 14:16:58 +01:00
|
|
|
void EventButtonCollection::AddButton(EventButton& button)
|
|
|
|
{
|
|
|
|
buttons.push_back(button);
|
|
|
|
}
|
|
|
|
|
|
|
|
EventButton& EventButtonCollection::CreateButton()
|
|
|
|
{
|
|
|
|
EventButton temp;
|
|
|
|
buttons.push_back(&temp);
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
EventCollectionState EventButtonCollection::GetState() const
|
|
|
|
{
|
|
|
|
return collectionState;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EventButtonCollection::SetState(const EventCollectionState state)
|
2014-01-31 13:06:11 +01:00
|
|
|
{
|
2014-01-31 14:16:58 +01:00
|
|
|
collectionState = state;
|
|
|
|
}
|
2014-01-31 13:06:11 +01:00
|
|
|
|
2014-01-31 14:16:58 +01:00
|
|
|
void EventButtonCollection::Clear()
|
|
|
|
{
|
|
|
|
buttons.clear();
|
|
|
|
collectionState = EventCollectionState_Enabled;
|
2014-01-31 13:06:11 +01:00
|
|
|
}
|