2014-02-11 09:16:01 +01:00
|
|
|
//////////////////////////////////////
|
|
|
|
// Created by Pontus Fransson 2014 //
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef MISC_EVENT_HANDLER_H
|
|
|
|
#define MISC_EVENT_HANDLER_H
|
2014-01-31 13:06:11 +01:00
|
|
|
|
|
|
|
#include "EventButtonCollection.h"
|
|
|
|
#include "EventButton.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Oyster
|
|
|
|
{
|
|
|
|
namespace Event
|
|
|
|
{
|
|
|
|
class EventHandler
|
|
|
|
{
|
2014-01-31 15:38:12 +01:00
|
|
|
public:
|
2014-01-31 13:06:11 +01:00
|
|
|
EventHandler();
|
|
|
|
~EventHandler();
|
|
|
|
|
2014-01-31 14:31:27 +01:00
|
|
|
static EventHandler& Instance();
|
2014-01-31 13:06:11 +01:00
|
|
|
|
2014-02-12 09:08:38 +01:00
|
|
|
void Clean();
|
|
|
|
|
2014-02-12 15:44:27 +01:00
|
|
|
void Update(MouseInput& input);
|
2014-02-13 15:21:05 +01:00
|
|
|
void RenderTexture();
|
|
|
|
void RenderText();
|
2014-01-31 13:06:11 +01:00
|
|
|
|
2014-02-12 09:49:57 +01:00
|
|
|
/*Add a collection to the EventHandler will only add collections not already present in the list.
|
|
|
|
|
|
|
|
*/
|
2014-02-11 14:13:35 +01:00
|
|
|
void AddCollection(EventButtonCollection* collection);
|
2014-02-12 15:12:01 +01:00
|
|
|
|
|
|
|
void ReleaseCollection(EventButtonCollection* collection);
|
2014-01-31 13:06:11 +01:00
|
|
|
|
2014-02-12 09:49:57 +01:00
|
|
|
private:
|
|
|
|
//Can't copy this class.
|
|
|
|
EventHandler(const EventHandler& obj);
|
|
|
|
EventHandler& operator =(const EventHandler& obj);
|
|
|
|
|
2014-01-31 13:06:11 +01:00
|
|
|
private:
|
|
|
|
std::vector<EventButtonCollection*> collections;
|
2014-02-12 09:49:57 +01:00
|
|
|
|
2014-02-12 15:12:01 +01:00
|
|
|
//EventButtonCollection is a friend so it can delete it self.
|
2014-02-12 09:08:38 +01:00
|
|
|
friend class EventButtonCollection;
|
2014-01-31 13:06:11 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|