本文整理汇总了C++中CCString::boolValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CCString::boolValue方法的具体用法?C++ CCString::boolValue怎么用?C++ CCString::boolValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCString
的用法示例。
在下文中一共展示了CCString::boolValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nodeWithDictionary
CCNode * SFLayer::nodeWithDictionary(CCDictionary * pDict)
{
CCString * pClassName = (CCString *)pDict->objectForKey("Class");
while (!pClassName)
{
// extend scroll layer
CCString * pScrollEnabled = (CCString *)pDict->objectForKey("ScrollEnabled");
if (pScrollEnabled && pScrollEnabled->boolValue())
{
pDict->setObject(CCString::stringWithCString("SFScrollLayer"), "Class");
break;
}
// extend scale layer
CCString * pScaleEnabled = (CCString *)pDict->objectForKey("ScaleEnabled");
if (pScaleEnabled && pScaleEnabled->boolValue())
{
pDict->setObject(CCString::stringWithCString("SFScaleLayer"), "Class");
break;
}
pDict->setObject(CCString::stringWithCString("SFLayer"), "Class");
break;
}
return SFNode::nodeWithDictionary(pDict);
}
示例2: onLogInCompleted
void MoreDiamondDialog::onLogInCompleted( CCNode *sender, void *data )
{
CCLOG("onLogInCompleted");
if (data != NULL)
{
CCDictionary *convertedData = (CCDictionary *)data;
CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
if (s->boolValue())
{
CCLOG("CPP Log In Completed: TRUE");
NDKHelper::AddSelector("MoreDiamondDialog",
"onGetProfileCompleted",
callfuncND_selector(MoreDiamondDialog::onGetProfileCompleted),
this);
SendMessageWithParams(string("GetProfile"), NULL);
}
else
{
CCLOG("CPP Log In Completed: FALSE");
CCMessageBox("Không thể kết nối", "Lỗi");
}
NDKHelper::RemoveSelector("MoreDiamondDialog", "onLogInCompleted");
}
}
示例3: onPublishFeedCompleted
void MoreDiamondDialog::onPublishFeedCompleted( CCNode *sender, void *data )
{
CCLOG("onPublishFeedCompleted");
if (data != NULL)
{
CCDictionary *convertedData = (CCDictionary *)data;
CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
if (s->boolValue())
{
CCLOG("CPP Publish Feed Completed: TRUE");
CCMessageBox(
CCString::createWithFormat("Bạn được nhận +%d kim cương.", CONF_INT(DIAMOND_FOR_SHARE))->getCString(),
"Thưởng");
DataManager::sharedDataManager()->AddDiamond(CONF_INT(DIAMOND_FOR_SHARE));
}
else
{
CCLOG("CPP Publish Feed Completed: FALSE");
CCMessageBox("Không thể chia sẻ", "Lỗi");
}
NDKHelper::RemoveSelector("MoreDiamondDialog", "onPublishFeedCompleted");
}
}
示例4: onInviteAllCompleted
void MoreDiamondDialog::onInviteAllCompleted( CCNode *sender, void *data )
{
if (data != NULL)
{
CCDictionary *convertedData = (CCDictionary *)data;
CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
if (s->boolValue())
{
CCLOG("CPP Invite All Completed: TRUE");
CCString* requestId = (CCString*)convertedData->objectForKey("requestId");
CCLOG("requestId: %s", requestId->getCString());
CCArray *arrFriends = (CCArray *)convertedData->objectForKey("invitedFriends");
int count = arrFriends->count();
int total = CONF_INT(DIAMOND_FOR_INVITE) * count;
DataManager::sharedDataManager()->AddDiamond(total);
CCMessageBox(CCString::createWithFormat("Bạn nhận được:\n%d x %d bạn = %d kim cương",
CONF_INT(DIAMOND_FOR_INVITE), count, total)->getCString(),
"Thưởng");
}
else
{
CCLOG("CPP Invite All Completed: FALSE");
CCMessageBox("Không thể mời bạn", "Lỗi");
}
NDKHelper::RemoveSelector("MoreDiamondDialog", "onInviteAllCompleted");
}
}
示例5: onRateCompleted
void MoreDiamondDialog::onRateCompleted( CCNode *sender, void *data )
{
if (data != NULL)
{
CCDictionary *convertedData = (CCDictionary *)data;
CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
if (s->boolValue())
{
CCLOG("CPP Rate Completed: TRUE");
CCString* s = (CCString*)convertedData->objectForKey("responseType");
CCLOG("%s", s->getCString());
if (s->compare("RATE") == 0)
{
CCMessageBox(
CCString::createWithFormat("Bạn được nhận +%d kim cương.", CONF_INT(DIAMOND_FOR_RATE))->getCString(),
"Thưởng");
DataManager::sharedDataManager()->AddDiamond(CONF_INT(DIAMOND_FOR_RATE));
DataManager::sharedDataManager()->SetIsRatedApp(true);
m_itlbRate->setEnabled(false);
m_itlbRate->setOpacity(100);
}
}
else
{
CCLOG("CPP Rate Completed: FALSE");
}
NDKHelper::RemoveSelector("MoreDiamondDialog", "onRateCompleted");
}
}
示例6: getBoolParameter
bool CComponentParameter::getBoolParameter(const string& name, bool& value)
{
CCString* str = dynamic_cast<CCString*>(parameters_->objectForKey(name));
if (!str)
{
return false;
}
value = str->boolValue();
return true;
}
示例7: boolValueFromDictionary
bool boolValueFromDictionary(CCDictionary * dict, const string & key)
{
CCString * result = dynamic_cast<CCString *>(dict->objectForKey(key));
if (result != NULL)
{
return result->boolValue();
}
else
{
return false;
}
}
示例8: onGetProfileCompleted
void MoreDiamondDialog::onGetProfileCompleted( CCNode *sender, void *data )
{
CCLOG("onGetProfileCompleted");
if (data != NULL)
{
CCDictionary *convertedData = (CCDictionary *)data;
CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
if (s->boolValue())
{
CCLOG("CPP Get Profile Completed: TRUE");
string fbId = ((CCString*)convertedData->objectForKey("id"))->getCString();
string firstName = ((CCString*)convertedData->objectForKey("firstName"))->getCString();
string name = ((CCString*)convertedData->objectForKey("name"))->getCString();
string username = ((CCString*)convertedData->objectForKey("username"))->getCString();
string birthday = ((CCString*)convertedData->objectForKey("birthday"))->getCString();
string picture50x50 = ((CCString*)convertedData->objectForKey("picture"))->getCString();
//save
DataManager::sharedDataManager()->SetFbID(fbId);
DataManager::sharedDataManager()->SetFbFullName(name);
DataManager::sharedDataManager()->SetName(name);
DataManager::sharedDataManager()->SetFbUserName(username);
//////////////////////////////////////////////////////////////////////////
NDKHelper::AddSelector("MoreDiamondDialog",
"onGetAvatarCompleted",
callfuncND_selector(MoreDiamondDialog::onGetAvatarCompleted),
this);
string w = "128";
string h = "128";
CCDictionary* prms = CCDictionary::create();
prms->setObject(CCString::create(fbId), "fbId");
prms->setObject(CCString::create(w), "width");
prms->setObject(CCString::create(h), "height");
SendMessageWithParams(string("GetAvatar"), prms);
}
else
{
CCLOG("CPP Get Profile Completed: FALSE");
CCMessageBox("Không thể kết nối", "Lỗi");
}
NDKHelper::RemoveSelector("MoreDiamondDialog", "onGetProfileCompleted");
}
}
示例9: callLuaFuncParReturn
//带参执行Lua方法有返回值
const char* SendLuaData::callLuaFuncParReturn(const char* luaFileName,const char* functionName,CCArray* arraypar,CCArray* arraypartype)
{
lua_State* ls = LuaEngine::defaultEngine()->getLuaStack()->getLuaState();
int isOpen = luaL_dofile(ls, getFileFullPath(luaFileName));
if(isOpen!=0){
CCLOG("Open Lua Error: %i", isOpen);
return NULL;
}
lua_getglobal(ls, functionName);
int countnum = arraypar->count();
if(countnum>0)
{
for (int i = 0; i<arraypar->count(); i++) {
CCString* typestr = (CCString*)arraypartype->objectAtIndex(i);
CCString* strnr = (CCString*)arraypar->objectAtIndex(i);
if(typestr->isEqual(CCString::create("string")))
{
lua_pushstring(ls, strnr->getCString());
}
else if(typestr->isEqual(CCString::create("int")))
{
lua_pushnumber(ls, strnr->intValue());
}
else if(typestr->isEqual(CCString::create("bool")))
{
lua_pushboolean(ls, strnr->boolValue());
}
}
}
/*
lua_call
第一个参数:函数的参数个数
第二个参数:函数返回值个数
*/
lua_call(ls, countnum, 1);
const char* iResult = lua_tostring(ls, -1);
return iResult;
}
示例10: onGetAvatarCompleted
void MoreDiamondDialog::onGetAvatarCompleted( CCNode* pSender, void *data )
{
CCLOG("onGetAvatarCompleted");
if (data != NULL)
{
CCDictionary *convertedData = (CCDictionary *)data;
CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
if (s->boolValue())
{
CCLOG("CPP Get Avatar Completed: TRUE");
DataManager::sharedDataManager()->SetFbIsLogIn(true);
CCString* path = (CCString*)convertedData->objectForKey("path");
DataManager::sharedDataManager()->SetFbPhotoPath(path->getCString());
MenuScene* parent = (MenuScene*) this->getParent();
parent->m_itFacbook->runAction(CCFadeOut::create(0.5f));
//show
if (m_curOperator.compare("invite") == 0)
{
inviteCallback(NULL);
}
else if (m_curOperator.compare("share") == 0)
{
shareCallback(NULL);
}
}
else
{
CCLOG("CPP Get Avatar Completed: FALSE");
CCMessageBox("Không thể kết nối", "Lỗi");
}
NDKHelper::RemoveSelector("MoreDiamondDialog", "onGetAvatarCompleted");
}
}