PageRenderTime 31ms CodeModel.GetById 12ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/TGame/TData/Data/DataIf.h

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