本文来自http://blog.csdn.net/runaying ,引用必须注明出处!
cocos2d-x节点(CCInteger.h)API
温馨提醒:为了大家能更好学习,强烈推荐大家看看本人的这篇博客 Cocos2d-X权威指南笔记
integer 简单的覆盖了一些方法没有太多内容
///\cocos2d-x-3.0alpha0\cocos2dx\cocoa
//integer 简单的覆盖了一些方法没有太多内容
#ifndef __CCINTEGER_H__
#define __CCINTEGER_H__
#include "CCObject.h"
#include "platform/CCCommon.h"
NS_CC_BEGIN
/**
* @addtogroup data_structures
* @{
*/
class CC_DLL Integer : public Object, public Clonable
{
public:
static Integer* create(int v)
{
Integer* pRet = new Integer(v);
pRet->autorelease();
return pRet;
}
/**
* @js NA
*/
Integer(int v)
: _value(v) {}
int getValue() const {return _value;}
/**
* @js NA
* @lua NA
*/
virtual ~Integer() {
CCLOGINFO("deallocing ~Integer: %p", this);
}
/* override functions */
virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); }
// overrides
virtual Integer* clone() const override
{
return Integer::create(_value);
}
private:
int _value;
};
// end of data_structure group
/// @}
NS_CC_END
#endif /* __CCINTEGER_H__ */