当前位置: 首页>>代码示例>>C++>>正文


C++ CCString::uintValue方法代码示例

本文整理汇总了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"));
}
开发者ID:bontey,项目名称:cocos2d-x-tools,代码行数:29,代码来源:YHEffectGenerator.cpp

示例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;
	}
}
开发者ID:QiuleiWang,项目名称:cocos2d-x-2.x-utils,代码行数:12,代码来源:CommonUtils.cpp

示例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;
}
开发者ID:lkeplei,项目名称:QeeQoo,代码行数:52,代码来源:GameObject.cpp

示例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);
}
开发者ID:bontey,项目名称:cocos2d-x-tools,代码行数:14,代码来源:YHAnimationHelper.cpp

示例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);
}
开发者ID:QiuleiWang,项目名称:cocos2d-x-2.x-utils,代码行数:23,代码来源:CommonUtils.cpp


注:本文中的CCString::uintValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。