/////////////////////// // Sam Svensson 2013 // /////////////////////// #include "../../Input/L_inputClass.h" #include #include "IEventButton.h" namespace Oyster { namespace Event { template class EventButton : public IEventButton { private: struct PrivData { static unsigned int currID; unsigned int ID; owner owner; void (*EventFunc)( ButtonEvent e ); }; PrivData privData; public: EventButton(); EventButton(owner owner); EventButton(void (*EventFunc)( ButtonEvent e)); EventButton(void (*EventFunc)( ButtonEvent e), owner owner); ~EventButton(); void checkCollision(InputClass *input); void SetEventFunc(void (*EventFunc)( ButtonEvent e )); //? unsigned int GetID(); owner& GetOwner(); }; template EventButton::EventButton() { this->privData.ID = privData.currID; this->privData.currID += 1; this->privData.owner = NULL; this->privData.EventFunc = NULL; } template EventButton::EventButton(owner owner) { this->privData.ID = privData.currID; this->privData.currID += 1; this->privData.owner = owner; this->privData.EventFunc = NULL; } template EventButton::EventButton(void (*EventFunc)( ButtonEvent e)) { this->privData.ID = privData.currID; this->privData.currID += 1; this->privData.owner = NULL; this->privData.EventFunc = EventFunc; } template EventButton::EventButton(void (*EventFunc)( ButtonEvent e), owner owner) { this->privData.ID = privData.currID; this->privData.currID += 1; this->privData.owner = owner; this->privData.EventFunc = EventFunc; } template EventButton~EventButton() { } template void EventButton::checkCollision(InputClass *input) { //??????????????? TODO: everything } template void EventButton::SetEventFunc(void (*EventFunc)( ButtonEvent e )) { this->privData.EventFunc = EventFunc; } template unsigned int EventButton::GetID() { return this->privData.ID; } template owner& EventButton::GetOwner() { return this->privData.owner; } } }