本文整理汇总了C++中NF_SHARE_PTR::GetColTag方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetColTag方法的具体用法?C++ NF_SHARE_PTR::GetColTag怎么用?C++ NF_SHARE_PTR::GetColTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::GetColTag方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: RefreshBaseProperty
int NFCPropertyModule::RefreshBaseProperty(const NFGUID& self)
{
NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_CommPropertyValue());
if (!pRecord.get())
{
return 1;
}
//初始属性+等级属性(职业决定)
NFJobType eJobType = (NFJobType)m_pKernelModule->GetPropertyInt(self, NFrame::Player::Job());
int nLevel = m_pKernelModule->GetPropertyInt(self, NFrame::Player::Level());
for (int i = 0; i < pRecord->GetCols(); ++i)
{
const std::string& strColTag = pRecord->GetColTag(i);
int nValue = m_pPropertyConfigModule->CalculateBaseValue(eJobType, nLevel, strColTag);
SetPropertyValue(self, strColTag, NFPropertyGroup::NPG_JOBLEVEL, nValue);
}
return 1;
}
示例3: CalEquipRandomProperty
bool NFCEquipPropertyModule::CalEquipRandomProperty(const NFGUID& self, const NFGUID& xEquipGUID, NFDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pBagRecord = m_pKernelModule->FindRecord(self, NFrame::Player::BagEquipList::ThisName());
if (nullptr == pBagRecord)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pCommPropertyValueRecord = m_pKernelModule->FindRecord(self, NFrame::Player::CommValue::ThisName());
if (nullptr == pCommPropertyValueRecord)
{
return false;
}
NFDataList varFind;
if (pBagRecord->FindObject(NFrame::Player::BagEquipList::GUID, xEquipGUID, varFind) != 1)
{
return false;
}
const int nRow = varFind.Int32(0);
xDataList.Clear();
/////////////RandomBase/////////////////////////////////////////
const std::string& strConfigID = pBagRecord->GetString(nRow, NFrame::Player::BagEquipList::BagEquipList::RandPropertyID);
const std::string& strPropertyEffectData = m_pElementModule->GetPropertyString(strConfigID, NFrame::Equip::EffectData());
if (!strPropertyEffectData.empty())
{
for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i)
{
const std::string& strColTag = pCommPropertyValueRecord->GetColTag(i);
int64_t nValue = m_pElementModule->GetPropertyInt(strPropertyEffectData, strColTag);
xDataList.AddInt(nValue);
}
}
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;
}
示例5: OnRecordPropertyEvent
int NFCPropertyModule::OnRecordPropertyEvent(const NFGUID& self, const RECORD_EVENT_DATA& xEventData, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar)
{
//计算总值
const std::string& strRecordName = xEventData.strRecordName;
const int nOpType = xEventData.nOpType;
const int nRow = xEventData.nRow;
const int nCol = xEventData.nCol;
int nAllValue = 0;
NF_SHARE_PTR<NFIRecord> pRecord = m_pKernelModule->FindRecord(self, NFrame::Player::R_CommPropertyValue());
for (int i = 0; i < (int)(NFPropertyGroup::NPG_ALL); i++)
{
if (i < pRecord->GetRows())
{
int nValue = pRecord->GetInt(i, nCol);
nAllValue += nValue;
}
}
m_pKernelModule->SetPropertyInt(self, pRecord->GetColTag(nCol), nAllValue);
return 0;
}
示例6: CalEquipGemProperty
bool NFCEquipPropertyModule::CalEquipGemProperty(const NFGUID& self, const NFGUID& xEquipGUID, NFDataList& xDataList)
{
NF_SHARE_PTR<NFIRecord> pBagRecord = m_pKernelModule->FindRecord(self, NFrame::Player::BagEquipList::ThisName());
if (nullptr == pBagRecord)
{
return false;
}
NF_SHARE_PTR<NFIRecord> pCommPropertyValueRecord = m_pKernelModule->FindRecord(self, NFrame::Player::CommValue::ThisName());
if (nullptr == pCommPropertyValueRecord)
{
return false;
}
NFDataList varFind;
if (pBagRecord->FindObject(NFrame::Player::BagEquipList::GUID, xEquipGUID, varFind) != 1)
{
return false;
}
const int nRow = varFind.Int32(0);
xDataList.Clear();
/////////////GemBase/////////////////////////////////////////
int nSlotCount = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::SlotCount);
if (nSlotCount <= 0)
{
return false;
}
for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i)
{
xDataList.AddInt(0);
}
for (int i = NFrame::Player::BagEquipList::InlayStone1; i <= NFrame::Player::BagEquipList::InlayStone10; ++i)
{
int nIndex = i - NFrame::Player::BagEquipList::InlayStone1;
if (nIndex > nSlotCount)
{
break;
}
const std::string& strGemID = pBagRecord->GetString(nRow, i);
if (strGemID.empty())
{
continue;
}
const std::string& strGemEffectData = m_pElementModule->GetPropertyString(strGemID, NFrame::Item::EffectData());
if (strGemEffectData.empty())
{
continue;
}
//one gem
for (int j = 0; j < pCommPropertyValueRecord->GetCols(); ++j)
{
const std::string& strColTag = pCommPropertyValueRecord->GetColTag(j);
int64_t nValue = m_pElementModule->GetPropertyInt(strGemEffectData, strColTag);
int64_t nOldValue = xDataList.Int(j);
xDataList.SetInt(j, nOldValue + nValue);
}
}
return true;
}