Added CCFloat, CCDouble and CCBool

This commit is contained in:
Tomoaki Shimizu 2012-12-27 23:15:13 +09:00
parent 771b99a6b7
commit 87146d82e1
4 changed files with 108 additions and 0 deletions

35
cocos2dx/cocoa/CCBool.h Executable file
View File

@ -0,0 +1,35 @@
#ifndef __CCBOOL_H__
#define __CCBOOL_H__
#include "CCObject.h"
NS_CC_BEGIN
/**
* @addtogroup data_structures
* @{
*/
class CC_DLL CCBool : public CCObject
{
public:
CCBool(bool v)
: m_nValue(v) {}
bool getValue() const {return m_nValue;}
static CCBool* create(bool v)
{
CCBool* pRet = new CCBool(v);
pRet->autorelease();
return pRet;
}
private:
double m_nValue;
};
// end of data_structure group
/// @}
NS_CC_END
#endif /* __CCBOOL_H__ */

35
cocos2dx/cocoa/CCDouble.h Executable file
View File

@ -0,0 +1,35 @@
#ifndef __CCDOUBLE_H__
#define __CCDOUBLE_H__
#include "CCObject.h"
NS_CC_BEGIN
/**
* @addtogroup data_structures
* @{
*/
class CC_DLL CCDouble : public CCObject
{
public:
CCDouble(double v)
: m_nValue(v) {}
double getValue() const {return m_nValue;}
static CCDouble* create(double v)
{
CCDouble* pRet = new CCDouble(v);
pRet->autorelease();
return pRet;
}
private:
double m_nValue;
};
// end of data_structure group
/// @}
NS_CC_END
#endif /* __CCDOUBLE_H__ */

35
cocos2dx/cocoa/CCFloat.h Executable file
View File

@ -0,0 +1,35 @@
#ifndef __CCFLOAT_H__
#define __CCFLOAT_H__
#include "CCObject.h"
NS_CC_BEGIN
/**
* @addtogroup data_structures
* @{
*/
class CC_DLL CCFloat : public CCObject
{
public:
CCFloat(float v)
: m_nValue(v) {}
float getValue() const {return m_nValue;}
static CCFloat* create(float v)
{
CCFloat* pRet = new CCFloat(v);
pRet->autorelease();
return pRet;
}
private:
float m_nValue;
};
// end of data_structure group
/// @}
NS_CC_END
#endif /* __CCFLOAT_H__ */

View File

@ -64,6 +64,9 @@ THE SOFTWARE.
#include "cocoa/CCSet.h"
#include "cocoa/CCAutoreleasePool.h"
#include "cocoa/CCInteger.h"
#include "cocoa/CCFloat.h"
#include "cocoa/CCDouble.h"
#include "cocoa/CCBool.h"
#include "cocoa/CCString.h"
#include "cocoa/CCNS.h"
#include "cocoa/CCZone.h"