PageRenderTime 17ms CodeModel.GetById 8ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1#ifndef __OBS_IMPLEMENTATION___
 2#define __OBS_IMPLEMENTATION___
 3
 4#include "ObsIf.h"
 5
 6class ObsImp : public IObs
 7{
 8public:
 9
10	//	
11	//	ID
12	//
13	virtual int		getID()const;	
14
15	//
16	//	Class identifier
17	//
18	virtual int		getClass()const;
19
20	//
21	//	Mutex Rule
22	//
23	virtual int		getMutexRule()const;	
24
25	//
26	//	Mutex Group
27	//
28	virtual int		getMutexGroup()const;
29
30	//
31	//	Time To Live (Duration)
32	//
33	virtual int		getDuration()const;	
34
35	//
36	//	Static Gene Data
37	virtual IData*	getStaticData();
38
39	//
40	//	invoked just after gene's construction
41	//	which is used to do all the initialization
42	//
43	virtual bool onInit(IGeneCreateData& createData);
44
45	//
46	//	invoked just after gene is attached on a host object
47	//
48	virtual bool onAttach();
49	//
50	//	invoked when gene is detached from its host object
51	//
52	virtual bool onDetach();
53	//
54	//	update with the host object
55	//
56	virtual bool onUpdate(const int& nElapse);
57	//
58	//	response on a gene event, this is the only way gene communicate with outside logic
59	//	Note that gene can received a event only after he register it.
60	//	this the only way, gene get information from outside world,
61	//	in fact, gene is not an open man, he only trust his host, and only handle 
62	//	those events that register to his host before.
63	//
64	virtual void onEvent(IEvt& evt);
65};
66
67#endif