本文整理汇总了C++中PlayerData::GetGold方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerData::GetGold方法的具体用法?C++ PlayerData::GetGold怎么用?C++ PlayerData::GetGold使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerData
的用法示例。
在下文中一共展示了PlayerData::GetGold方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onButtonPur
void userInfoUIView::onButtonPur(cocos2d::CCObject * pSender, cocos2d::extension::CCControlEvent pCCControlEvent)
{
SoundSystem::GetSingleton()->playClickEffect(GAME_CLICK_COMMON);
char buffer[512] = {0};
X_INT buyNum = -1;
X_INT level = -1;
X_INT money =-1;
if (DataPool::GetSingleton())
{
ObjectManager* pM = DataPool::GetSingleton()->getObjectManager();
if (!pM)return;
ObjectSelf* pSelf = pM->getSelf();
if (!pSelf)return;
PlayerData* pData = pSelf->playerData();
if (!pData)return;
buyNum = pData->GetBuyAcNum();
level = pData->GetLevel();
money = pData->GetGold();
}
if (buyNum >=ActionPointBuyNum)
{
string tip = UtilTools::GET_TEXT_FROM_LANG( 587);
if (tip != "")
{
vector<string> strV;strV.clear();
strV.push_back(tip);
EventSystem::GetSingleton()->PushEvent(GAME_EVENT_TIP_UPDATA,strV);
}
return;
}
const DataBase* pDataFile = DataBaseSystem::GetSingleton()->GetDataBase(DBC_FILE_BUYACTIONPOINT);
if (!pDataFile)return;
const stDBC_FILE_BUYACTIONPOINT * m_pTableData =(const stDBC_FILE_BUYACTIONPOINT*)pDataFile->GetFieldsByIndexKey(buyNum+1);
if (!m_pTableData)return;
if (level<m_pTableData->level)
{
string tip = UtilTools::GET_TEXT_FROM_LANG( 588);
if (tip != "")
{
vector<string> strV;strV.clear();
strV.push_back(tip);
EventSystem::GetSingleton()->PushEvent(GAME_EVENT_TIP_UPDATA,strV);
}
return;
}
if (money < m_pTableData->cost)
{
string tip = UtilTools::GET_TEXT_FROM_LANG(102);
if (tip != "")
{
vector<string> strV;strV.clear();
strV.push_back(tip);
EventSystem::GetSingleton()->PushEvent(GAME_EVENT_TIP_UPDATA,strV);
}
return;
}
sprintf(buffer,UtilTools::GET_TEXT_FROM_LANG(543),m_pTableData->cost,m_pTableData->addAction);
ModalDialogView *dialogPur = ModalDialogView::createDialog( buffer,this);
dialogPur->setTag(1000);
addChild(dialogPur,10);
}