Changeset 4346 in orxonox.OLD for orxonox/trunk/src/util/event/event_handler.h
- Timestamp:
- May 27, 2005, 11:53:50 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/event_handler.h
r4329 r4346 1 1 /*! 2 \file proto_singleton.h3 \brief Definition of the ... singleton Class2 \file event_handler.h 3 \brief Definition of the EventHandler 4 4 5 5 */ 6 6 7 #ifndef _ PROTO_SINGLETON_H8 #define _ PROTO_SINGLETON_H7 #ifndef _EVENT_HANDLER_H 8 #define _EVENT_HANDLER_H 9 9 10 10 #include "base_object.h" 11 11 12 // FORWARD DEFINITION 12 class EventListener; 13 template<class T> class tList; 13 14 14 //! A default singleton class. 15 class ProtoSingleton : public BaseObject { 15 typedef enum elState 16 { 17 ES_GAME, 18 ES_GAME_MENU, 19 ES_MENU, 20 21 ES_NUMBER, 22 }; 23 24 25 //! The one Event Handler from Orxonox 26 class EventHandler : public BaseObject { 16 27 17 28 public: 18 static ProtoSingleton* getInstance(void); 19 virtual ~ProtoSingleton(void); 29 static EventHandler* getInstance(void); 30 virtual ~EventHandler(void); 31 32 void subscribeListener(EventListener* el, elState state); 33 void unsubscribeListener(EventListener* el, elState state); 34 void flush(); 35 36 void loadKeyBindings(const char* fileName); 37 38 void tick(float t); 20 39 21 40 private: 22 ProtoSingleton(void); 23 static ProtoSingleton* singletonRef; 41 EventHandler(void); 42 static EventHandler* singletonRef; 43 44 EventListener** listeners; //!< a list of registered listeners 45 24 46 }; 25 47 26 #endif /* _ PROTO_SINGLETON_H */48 #endif /* _EVENT_HANDLER_H */
Note: See TracChangeset
for help on using the changeset viewer.