/TGame/TCommon/Observer/ObsImp.h
http://awoe.googlecode.com/ · C Header · 67 lines · 19 code · 11 blank · 37 comment · 0 complexity · e877420a732c8413f1e874f99f499454 MD5 · raw file
- #ifndef __OBS_IMPLEMENTATION___
- #define __OBS_IMPLEMENTATION___
-
- #include "ObsIf.h"
-
- class ObsImp : public IObs
- {
- public:
-
- //
- // ID
- //
- virtual int getID()const;
-
- //
- // Class identifier
- //
- virtual int getClass()const;
-
- //
- // Mutex Rule
- //
- virtual int getMutexRule()const;
-
- //
- // Mutex Group
- //
- virtual int getMutexGroup()const;
-
- //
- // Time To Live (Duration)
- //
- virtual int getDuration()const;
-
- //
- // Static Gene Data
- virtual IData* getStaticData();
-
- //
- // invoked just after gene's construction
- // which is used to do all the initialization
- //
- virtual bool onInit(IGeneCreateData& createData);
-
- //
- // invoked just after gene is attached on a host object
- //
- virtual bool onAttach();
- //
- // invoked when gene is detached from its host object
- //
- virtual bool onDetach();
- //
- // update with the host object
- //
- virtual bool onUpdate(const int& nElapse);
- //
- // response on a gene event, this is the only way gene communicate with outside logic
- // Note that gene can received a event only after he register it.
- // this the only way, gene get information from outside world,
- // in fact, gene is not an open man, he only trust his host, and only handle
- // those events that register to his host before.
- //
- virtual void onEvent(IEvt& evt);
- };
-
- #endif