Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4346 in orxonox.OLD for orxonox/trunk/src/util/event/event_handler.h


Ignore:
Timestamp:
May 27, 2005, 11:53:50 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: some first function and class definition of the new event handling system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/event/event_handler.h

    r4329 r4346  
    11/*!
    2     \file proto_singleton.h
    3     \brief Definition of the ... singleton Class
     2    \file event_handler.h
     3    \brief Definition of the EventHandler
    44   
    55*/
    66
    7 #ifndef _PROTO_SINGLETON_H
    8 #define _PROTO_SINGLETON_H
     7#ifndef _EVENT_HANDLER_H
     8#define _EVENT_HANDLER_H
    99
    1010#include "base_object.h"
    1111
    12 // FORWARD DEFINITION
     12class EventListener;
     13template<class T> class tList;
    1314
    14 //! A default singleton class.
    15 class ProtoSingleton : public BaseObject {
     15typedef 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
     26class EventHandler : public BaseObject {
    1627
    1728 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);
    2039
    2140 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 
    2446};
    2547
    26 #endif /* _PROTO_SINGLETON_H */
     48#endif /* _EVENT_HANDLER_H */
Note: See TracChangeset for help on using the changeset viewer.