PageRenderTime 28ms CodeModel.GetById 12ms app.highlight 11ms RepoModel.GetById 2ms app.codeStats 0ms

/TGame/TData/Data/DataImp.h

http://awoe.googlecode.com/
C++ Header | 67 lines | 32 code | 12 blank | 23 comment | 0 complexity | 9eb770245cf4f6ac1b052c8a6268068c MD5 | raw file
 1#ifndef __T_GAME_DATA_BASE__IMP__
 2#define __T_GAME_DATA_BASE__IMP__
 3
 4#include "DataIf.h"
 5
 6//
 7//	Data Interface
 8//	Which is a most use data cluster interface used in my design
 9//
10class TDATA_API DataImp : public IData
11{
12public:
13	DataImp(int nID = 0, int nGroupID = 0);
14	virtual ~DataImp();
15
16	//	
17	//	ID
18	//
19	virtual void	setID(int nID);
20	virtual int		getID()const;
21
22	//
23	//	Group ID
24	//
25	virtual void	setGroupID(int nGrpID);
26	virtual int		getGroupID()const;	
27
28
29	//
30	//	Data X, Y, Z
31	//	Which is used most frequently
32	//
33	virtual void	setDataX(int x);
34	virtual void	setDataY(int y);
35	virtual void	setDataZ(int z);
36
37	virtual int		getDataX()const;
38	virtual int		getDataY()const;
39	virtual int		getDataZ()const;
40
41	//
42	//	Data Extension, more data
43	//
44	virtual	int		getData(const short& nIdx, int nDefault)const;
45	virtual void	setData(const short& nIdx, int nValue);
46
47	//
48	//	Data Extension, more data, string as key
49	//
50	virtual	int		getData(const char* szKey, int nDefault = 0)const;
51	virtual void	setData(const char* szKey, int nValue);
52
53	//
54	//	Data Extension, more data, string as key, string as data
55	//
56	virtual	int		getData(const char* szKey, string& sValue)const;
57	virtual void	setData(const char* szKey, const string& sValue);
58protected:
59	int m_nID;
60	int m_nGrp;
61
62	int m_nArgX;
63	int m_nArgY;
64	int m_nArgZ;
65};
66
67#endif