本文整理汇总了C++中NFIDataList::AddInt方法的典型用法代码示例。如果您正苦于以下问题:C++ NFIDataList::AddInt方法的具体用法?C++ NFIDataList::AddInt怎么用?C++ NFIDataList::AddInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NFIDataList
的用法示例。
在下文中一共展示了NFIDataList::AddInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalHeroAllProperty
bool NFCHeroPropertyModule::CalHeroAllProperty(const NFGUID& self, const NFGUID& xHeroGUID, NFIDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_PlayerHero());
if (nullptr == pHeroRecord)
{
return false;
}
NFCDataList varFind;
if (pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, xHeroGUID, varFind) != 1)
{
return false;
}
const int nRow = varFind.Int(0);
NF_SHARE_PTR<NFIRecord> pHeroPropertyRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_HeroPropertyValue());
if (nullptr == pHeroPropertyRecord)
{
return false;
}
NFCDataList xHeroPropertyValue;
CalHeroBaseProperty(self, xHeroGUID, xHeroPropertyValue);
NFCDataList xHeroTalentValue;
CalHeroTalentProperty(self, xHeroGUID, xHeroTalentValue);
NFCDataList xHeroEquipValue;
CalHeroEquipProperty(self, xHeroGUID, xHeroEquipValue);
for (int i = 0; i < pHeroPropertyRecord->GetCols(); ++i)
{
int nPropertyValue = 0;
int nTalentValue = 0;
int nEquipValue = 0;
if (xHeroPropertyValue.GetCount() == pHeroPropertyRecord->GetCols())
{
nPropertyValue = xHeroPropertyValue.Int(i);
}
if (xHeroTalentValue.GetCount() == pHeroPropertyRecord->GetCols())
{
nTalentValue = xHeroTalentValue.Int(i);
}
if (xHeroEquipValue.GetCount() == pHeroPropertyRecord->GetCols())
{
nEquipValue = xHeroEquipValue.Int(i);
}
int nAllValue = nPropertyValue + nTalentValue + nEquipValue;
xDataList.AddInt(nAllValue);
}
return true;
}
示例2: CalHeroTalentProperty
bool NFCHeroPropertyModule::CalHeroTalentProperty(const NFGUID& self, const NFGUID& xHeroGUID, NFIDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_PlayerHero());
if (nullptr == pHeroRecord)
{
return false;
}
NFCDataList varFind;
if (pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, xHeroGUID, varFind) != 1)
{
return false;
}
const int nRow = varFind.Int(0);
NF_SHARE_PTR<NFIRecord> pHeroPropertyRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_HeroPropertyValue());
if (nullptr == pHeroPropertyRecord)
{
return false;
}
////////////////////Talent//////////////////////////////////////////////////////
xDataList.Clear();
for (int i = 0; i < pHeroPropertyRecord->GetCols(); ++i)
{
xDataList.AddInt(0);
}
for (int i = NFrame::Player::PlayerHero_Talent1; i <= NFrame::Player::PlayerHero_Talent5; ++i)
{
const std::string& strTalentID = pHeroRecord->GetString(nRow, i);
const std::string& strTalentEffectData = m_pElementModule->GetPropertyString(strTalentID, NFrame::Talent::EffectData());
if (!strTalentEffectData.empty())
{
//one talent
for (int j = 0; j < pHeroPropertyRecord->GetCols(); ++j)
{
const std::string& strColTag = pHeroPropertyRecord->GetColTag(j);
int nValue = m_pElementModule->GetPropertyInt(strTalentEffectData, strColTag);
int nOldValue = xDataList.Int(j);
xDataList.SetInt(j, nOldValue + nValue);
}
}
}
return true;
}
示例3: CalHeroEquipProperty
bool NFCHeroPropertyModule::CalHeroEquipProperty(const NFGUID& self, const NFGUID& xHeroGUID, NFIDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_PlayerHero());
if (nullptr == pHeroRecord)
{
return false;
}
NFCDataList varFind;
if (pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, xHeroGUID, varFind) != 1)
{
return false;
}
const int nRow = varFind.Int(0);
NF_SHARE_PTR<NFIRecord> pHeroPropertyRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_HeroPropertyValue());
if (nullptr == pHeroPropertyRecord)
{
return false;
}
////////////////////Equip//////////////////////////////////////////////////////
xDataList.Clear();
for (int i = 0; i < pHeroPropertyRecord->GetCols(); ++i)
{
xDataList.AddInt(0);
}
for (int i = NFrame::Player::PlayerHero_Equip1; i <= NFrame::Player::PlayerHero_Equip6; ++i)
{
NFCDataList EquipDataList;
const NFGUID xEquipID = pHeroRecord->GetObject(nRow, i);
if (!xEquipID.IsNull() && m_pEquipPropertyModule->CalEquipProperty(self, xEquipID, EquipDataList))
{
//one equip
for (int j = 0; j < pHeroPropertyRecord->GetCols(); ++j)
{
int nOldValue = xDataList.Int(j);
int nEquipValue = EquipDataList.Int(j);
xDataList.SetInt(j, nOldValue + nEquipValue);
}
}
}
return true;
}
示例4: CalHeroBaseProperty
bool NFCHeroPropertyModule::CalHeroBaseProperty(const NFGUID& self, const NFGUID& xHeroGUID, NFIDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_PlayerHero());
if (nullptr == pHeroRecord)
{
return false;
}
NFCDataList varFind;
if (pHeroRecord->FindObject(NFrame::Player::PlayerHero_GUID, xHeroGUID, varFind) != 1)
{
return false;
}
const int nRow = varFind.Int(0);
NF_SHARE_PTR<NFIRecord> pHeroPropertyRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_HeroPropertyValue());
if (nullptr == pHeroPropertyRecord)
{
return false;
}
/////////////PropertyBase/////////////////////////////////////////
xDataList.Clear();
const std::string& strConfigID = pHeroRecord->GetString(nRow, NFrame::Player::PlayerHero::PlayerHero_ConfigID);
const std::string& strPropertyEffectData = m_pElementModule->GetPropertyString(strConfigID, NFrame::NPC::EffectData());
if (!strPropertyEffectData.empty())
{
for (int i = 0; i < pHeroPropertyRecord->GetCols(); ++i)
{
const std::string& strColTag = pHeroPropertyRecord->GetColTag(i);
int nValue = m_pElementModule->GetPropertyInt(strPropertyEffectData, strColTag);
xDataList.AddInt(nValue);
}
}
return true;
}