本文整理汇总了C++中CCString::uintValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CCString::uintValue方法的具体用法?C++ CCString::uintValue怎么用?C++ CCString::uintValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCString
的用法示例。
在下文中一共展示了CCString::uintValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
YHEffectDefiner::YHEffectDefiner(CCDictionary * dict)
{
CCString * strPieces = dynamic_cast<CCString *>(dict->objectForKey("Pieces"));
if (strPieces != NULL)
{
uint32 pieces = strPieces->uintValue();
if (pieces == 2)
{
m_type = kEffectDefineType_Piece2;
}
else if (pieces == 4)
{
m_type = kEffectDefineType_Piece4;
}
else
{
m_type = kEffectDefineType_Piece1;
}
}
else
{
m_type = kEffectDefineType_Piece1;
}
CCString * name = dynamic_cast<CCString *>(dict->objectForKey("PieceKey"));
m_animationName = string(name->getCString());
m_spriteDefiner = YHSpriteDefiner((CCDictionary *)dict->objectForKey("SpriteDefiner"));
}
示例2: uintValueFromDictionary
uint32 uintValueFromDictionary(CCDictionary * dict, const string & key)
{
CCString * result = dynamic_cast<CCString *>(dict->objectForKey(key));
if (result != NULL)
{
return result->uintValue();
}
else
{
return 0;
}
}
示例3: initWithDictionary
bool GameDisplayNode::initWithDictionary(CCDictionary * tmpDict){
CCNode * _displayNode = NULL;
if (tmpDict) {
CCString * strValue = (CCString *)tmpDict->objectForKey(KStrType);
uint32_t typeValue = strValue->uintValue();
strValue = (CCString *)tmpDict->objectForKey(KStrFile);
switch (typeValue) {
case GameObject::K_SPRITE_FRAME:
{
_displayNode = CCSprite::createWithSpriteFrameName(strValue->getCString());
this->addChild(_displayNode);
_defaultFrame = strValue->getCString();
}
break;
case GameObject::K_SPRITE_FILE:
{
_displayNode = CCSprite::create(strValue->getCString());
this->addChild(_displayNode);
_defaultFrame = strValue->getCString();
}
break;
case GameObject::K_CCBI_FILE:
{
//动画加载
CC_SAFE_RELEASE_NULL(_animationManager);
string ccbifile = strValue->getCString();
CCNodeLoaderLibrary *ccNodeLoaderLibrary = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
CCBReader * ccBReader = new CCBReader(ccNodeLoaderLibrary);
_displayNode = ccBReader->readNodeGraphFromFile(ccbifile.c_str(),this,&_animationManager);
_animationManager->retain();
_animationManager->setDelegate(this);
this->addChild(_displayNode);
CC_SAFE_RELEASE_NULL(ccBReader);
CCString * default_frame = (CCString *)tmpDict->objectForKey(KStrDefaultFrame);
if (default_frame) {
_defaultFrame = default_frame->getCString();
}
CCString * default_anim=(CCString *)tmpDict->objectForKey(KStrDefaultAnim);
if (default_anim) {
_defaultAnimation = default_anim->getCString();
}
}
break;
default:
break;
}
}
return true;
}
示例4:
YHAnimationFrameDefiner::YHAnimationFrameDefiner(CCDictionary * dict)
{
// index
CCString * strIndex = dynamic_cast<CCString *>(dict->objectForKey("Index"));
m_index = strIndex->uintValue();
// Delay units
CCString * strDelayUnits = dynamic_cast<CCString *>(dict->objectForKey("DelayUnits"));
m_delayUnit = strDelayUnits != NULL ? strDelayUnits->floatValue() : 1.0f;
// UserData
m_userInfo = dynamic_cast<CCDictionary *>(dict->objectForKey("UserInfo"));
CC_SAFE_RETAIN(m_userInfo);
}
示例5: createPriceWithDictionary
Price createPriceWithDictionary(CCDictionary * dict)
{
Price::CoinType coinType;
uint32 value;
CCString * strType = (CCString *)dict->objectForKey(PRICE_TYPE_KEY);
if (strType->compare(PRICE_COIN) == 0)
{
coinType = Price::kCoinType_Coin;
}
else if (strType->compare(PRICE_GEM) == 0)
{
coinType = Price::kCoinType_Gem;
}
else
{
coinType = Price::kCoinType_Unknown;
}
CCString * strNumber = (CCString *)dict->objectForKey(PRICE_VALUE_KEY);
value = strNumber->uintValue();
return Price(coinType, value);
}