PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/TGame/TCommon/Gene/GeneCreateDataB.h

http://awoe.googlecode.com/
C++ Header | 82 lines | 36 code | 15 blank | 31 comment | 0 complexity | e86297222fbe54dc495976317a1135a4 MD5 | raw file
 1#ifndef __GENE_CREATE_DATA__BASE__IMPLEMENTATION
 2#define __GENE_CREATE_DATA__BASE__IMPLEMENTATION
 3
 4#include "GeneCreateDataIf.h"
 5
 6
 7//
 8//	dynamic data interface for creating an gene
 9//	different gene will require different environment data when create it.
10//	implement this interface to ensure anything is possible for gene creation.
11//
12class TCOM_API  GeneCreateDataB : public IGeneCreateData
13{
14public:
15	GeneCreateDataB(int nID, int nGrpID);
16	GeneCreateDataB(IData* pData);
17	virtual ~GeneCreateDataB();
18
19	//	
20	//	ID
21	//
22	virtual void	setID(int nID);
23	virtual int		getID()const;
24
25	//
26	//	Group ID
27	//
28	virtual void	setGroupID(int nGrpID);
29	virtual int		getGroupID()const;	
30
31	//
32	//	Class identifier
33	//
34	virtual int		getClass()const;
35
36	//
37	//	Data X, Y, Z
38	//	Which is used most frequently
39	//
40	virtual void	setDataX(int x);
41	virtual void	setDataY(int y);
42	virtual void	setDataZ(int z);
43
44	virtual int		getDataX()const;
45	virtual int		getDataY()const;
46	virtual int		getDataZ()const;
47
48	//
49	//	Data Extension, more data
50	//
51	virtual	int		getData(const short& nIdx, int nDefault)const;
52	virtual void	setData(const short& nIdx, int nValue);
53
54	//
55	//	get the static data
56	//	
57	virtual IData*		getStaticData();
58
59	//
60	//	Time to live for an gene on his host
61	//	This will override the duration that configured in gene static data
62	//
63	virtual int			getDuration()const;
64
65	//
66	//	entity
67	//
68	virtual int			getSrcEntityID()const;
69	virtual IEntity*	getSrcEntity()const;
70	virtual IScene*		getSrcScene()const;
71protected:
72	int	m_nGeneID;
73	int	m_nGeneGrpID;
74	IData* m_wpSData;
75
76	int m_nArgX;
77	int m_nArgY;
78	int m_nArgZ;
79
80};
81
82#endif