2014-01-31 13:06:11 +01:00
|
|
|
#ifndef EVENT_BUTTON_COLLECTION_H
|
|
|
|
#define EVENT_BUTTON_COLLECTION_H
|
|
|
|
|
|
|
|
#include "../../Input/L_inputClass.h"
|
|
|
|
|
2014-01-31 15:06:30 +01:00
|
|
|
#include "IEventButton.h"
|
2014-01-31 13:06:11 +01:00
|
|
|
#include "EventButton.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Oyster
|
|
|
|
{
|
|
|
|
namespace Event
|
|
|
|
{
|
2014-01-31 14:16:58 +01:00
|
|
|
enum EventCollectionState
|
|
|
|
{
|
|
|
|
EventCollectionState_Disabled,
|
|
|
|
EventCollectionState_Enabled,
|
|
|
|
|
|
|
|
EventCollectionState_Count,
|
|
|
|
EventCollectionState_Unknown = -1,
|
|
|
|
};
|
|
|
|
|
2014-01-31 13:06:11 +01:00
|
|
|
class EventButtonCollection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EventButtonCollection();
|
|
|
|
~EventButtonCollection();
|
|
|
|
|
|
|
|
void Update(InputClass* inputObject);
|
|
|
|
|
2014-01-31 15:06:30 +01:00
|
|
|
template <class Owner>
|
2014-02-03 10:41:54 +01:00
|
|
|
void AddButton(Owner a);
|
2014-01-31 15:06:30 +01:00
|
|
|
|
|
|
|
template <class Owner>
|
|
|
|
EventButton<Owner>& CreateButton();
|
2014-01-31 14:16:58 +01:00
|
|
|
|
|
|
|
EventCollectionState GetState() const;
|
|
|
|
void SetState(const EventCollectionState state);
|
|
|
|
|
|
|
|
//Clear all buttons and reset the state.
|
|
|
|
void Clear();
|
2014-01-31 13:06:11 +01:00
|
|
|
|
|
|
|
private:
|
2014-01-31 15:06:30 +01:00
|
|
|
std::vector<IEventButton*> buttons;
|
2014-01-31 14:16:58 +01:00
|
|
|
EventCollectionState collectionState;
|
2014-01-31 13:06:11 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|