variable property define

This commit is contained in:
Walzer 2010-07-06 09:20:53 +00:00
parent 1015e4e7e4
commit 344c99e5e6
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#ifndef __COCOS2D_DEFINE_H__
#define __COCOS2D_DEFINE_H__
#define GET_VARIABLE(varType, varName)\
public inline varType get##varName() { return varName; };
#define SET_VARIABLE(varType, varName)\
public inline void set##varName(varType funVar) { varName = funVar; };
#define VAR_PROPERTY_READONLY(varType, varName)\
protected varType m_##varName;\
GET_VARIABLE(varType, varName)
#define VAR_PROPERTY_READWRITE(varType, varName)\
protected varType m_##varName;\
GET_VARIABLE(varType, varName)\
SET_VARIABLE(varTYPE, varName)
#endif // __COCOS2D_DEFINE_H__