Untabify for CCBValue.cpp.

This commit is contained in:
James Chen 2013-07-28 00:31:09 +08:00
parent 075b83ad87
commit d67ab3e4cc
1 changed files with 25 additions and 27 deletions

View File

@ -1,7 +1,5 @@
#include "CCBValue.h" #include "CCBValue.h"
using namespace cocos2d;
NS_CC_EXT_BEGIN NS_CC_EXT_BEGIN
// Implementation of Color3BWapper // Implementation of Color3BWapper
@ -14,10 +12,10 @@ Color3BWapper* Color3BWapper::create(const Color3B& color)
ret->color.r = color.r; ret->color.r = color.r;
ret->color.g = color.g; ret->color.g = color.g;
ret->color.b = color.b; ret->color.b = color.b;
ret->autorelease(); ret->autorelease();
} }
return ret; return ret;
} }
@ -34,10 +32,10 @@ CCBValue* CCBValue::create(int nValue)
if (ret) if (ret)
{ {
ret->_value.intValue = nValue; ret->_value.intValue = nValue;
ret->_type = Type::INT; ret->_type = Type::INT;
ret->autorelease(); ret->autorelease();
} }
return ret; return ret;
} }
@ -47,10 +45,10 @@ CCBValue* CCBValue::create(float fValue)
if (ret) if (ret)
{ {
ret->_value.floatValue = fValue; ret->_value.floatValue = fValue;
ret->_type = Type::FLOAT; ret->_type = Type::FLOAT;
ret->autorelease(); ret->autorelease();
} }
return ret; return ret;
} }
@ -60,10 +58,10 @@ CCBValue* CCBValue::create(bool vValue)
if (ret) if (ret)
{ {
ret->_value.intValue = vValue ? 1 : 0; ret->_value.intValue = vValue ? 1 : 0;
ret->_type = Type::BOOL; ret->_type = Type::BOOL;
ret->autorelease(); ret->autorelease();
} }
return ret; return ret;
} }
@ -73,10 +71,10 @@ CCBValue* CCBValue::create(unsigned char byte)
if (ret) if (ret)
{ {
ret->_value.intValue = byte; ret->_value.intValue = byte;
ret->_type = Type::UNSIGNED_CHAR; ret->_type = Type::UNSIGNED_CHAR;
ret->autorelease(); ret->autorelease();
} }
return ret; return ret;
} }
@ -86,10 +84,10 @@ CCBValue* CCBValue::create(const char *pStringValue)
if (ret) if (ret)
{ {
ret->_strValue = pStringValue; ret->_strValue = pStringValue;
ret->_type = Type::STRING; ret->_type = Type::STRING;
ret->autorelease(); ret->autorelease();
} }
return ret; return ret;
} }
@ -103,51 +101,51 @@ CCBValue* CCBValue::create(Array *pArrValue)
ret->_type = Type::ARRAY; ret->_type = Type::ARRAY;
ret->autorelease(); ret->autorelease();
} }
return ret; return ret;
} }
int CCBValue::getIntValue() int CCBValue::getIntValue()
{ {
CCASSERT(_type == Type::INT, "The type of CCBValue isn't integer."); CCASSERT(_type == Type::INT, "The type of CCBValue isn't integer.");
return _value.intValue; return _value.intValue;
} }
float CCBValue::getFloatValue() float CCBValue::getFloatValue()
{ {
CCASSERT(_type == Type::FLOAT, "The type of CCBValue isn't float."); CCASSERT(_type == Type::FLOAT, "The type of CCBValue isn't float.");
return _value.floatValue; return _value.floatValue;
} }
bool CCBValue::getBoolValue() bool CCBValue::getBoolValue()
{ {
CCASSERT(_type == Type::BOOL, "The type of CCBValue isn't boolean."); CCASSERT(_type == Type::BOOL, "The type of CCBValue isn't boolean.");
return _value.intValue == 1 ? true : false; return _value.intValue == 1 ? true : false;
} }
unsigned char CCBValue::getByteValue() unsigned char CCBValue::getByteValue()
{ {
CCASSERT(_type == Type::UNSIGNED_CHAR, "The type of CCBValue isn't unsigned char."); CCASSERT(_type == Type::UNSIGNED_CHAR, "The type of CCBValue isn't unsigned char.");
return (unsigned char)(_value.intValue); return (unsigned char)(_value.intValue);
} }
Array* CCBValue::getArrayValue() Array* CCBValue::getArrayValue()
{ {
CCASSERT(_type == Type::ARRAY, "The type of CCBValue isn't array."); CCASSERT(_type == Type::ARRAY, "The type of CCBValue isn't array.");
return _arrValue; return _arrValue;
} }
const char* CCBValue::getStringValue() const char* CCBValue::getStringValue()
{ {
CCASSERT(_type == Type::STRING, "The type of CCBValue isn't string."); CCASSERT(_type == Type::STRING, "The type of CCBValue isn't string.");
return _strValue.c_str(); return _strValue.c_str();
} }