本文整理汇总了C++中NFDataList::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ NFDataList::Clear方法的具体用法?C++ NFDataList::Clear怎么用?C++ NFDataList::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NFDataList
的用法示例。
在下文中一共展示了NFDataList::Clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: QueryRow
bool NFCRecord::QueryRow(const int nRow, NFDataList& varList)
{
if (!ValidRow(nRow))
{
return false;
}
if (!IsUsed(nRow))
{
return false;
}
varList.Clear();
for (int i = 0; i < GetCols(); ++i)
{
NF_SHARE_PTR<NFData>& pVar = mtRecordVec.at(GetPos(nRow, i));
if (pVar)
{
varList.Append(*pVar);
}
else
{
switch (GetColType(i))
{
case TDATA_INT:
varList.Add(NFINT64(0));
break;
case TDATA_FLOAT:
varList.Add(0.0f);
break;
case TDATA_STRING:
varList.Add(NULL_STR.c_str());
break;
case TDATA_OBJECT:
varList.Add(NFGUID());
break;
case TDATA_VECTOR2:
varList.Add(NFVector2());
break;
case TDATA_VECTOR3:
varList.Add(NFVector3());
break;
default:
return false;
break;
}
}
}
if (varList.GetCount() != GetCols())
{
return false;
}
return true;
}
示例3: CalEquipProperty
bool NFCEquipPropertyModule::CalEquipProperty(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();
NFDataList xEquipBaseValue;
CalEquipBaseProperty(self, xEquipGUID, xEquipBaseValue);
NFDataList xEquipRandonValue;
CalEquipRandomProperty(self, xEquipGUID, xEquipRandonValue);
NFDataList xEquipGemValue;
CalEquipGemProperty(self, xEquipGUID, xEquipGemValue);
NFDataList xEquipIntensifyValue;
CalEquipIntensifyProperty(self, xEquipGUID, xEquipIntensifyValue);
NFDataList xEquipElementValue;
CalEquipElementProperty(self, xEquipGUID, xEquipElementValue);
for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i)
{
int64_t nBaseValue = 0;
int64_t nRandonValue = 0;
int64_t nGemValue = 0;
int64_t nIntensifyValue = 0;
int64_t nElementValue = 0;
if (xEquipBaseValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nBaseValue = xEquipBaseValue.Int(i);
}
if (xEquipRandonValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nRandonValue = xEquipRandonValue.Int(i);
}
if (xEquipGemValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nGemValue = xEquipGemValue.Int(i);
}
if (xEquipIntensifyValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nIntensifyValue = xEquipIntensifyValue.Int(i);
}
if (xEquipElementValue.GetCount() == pCommPropertyValueRecord->GetCols())
{
nElementValue = xEquipElementValue.Int(i);
}
int64_t nAllValue = nBaseValue + nRandonValue + nGemValue + nIntensifyValue + nElementValue;
xDataList.AddInt(nAllValue);
}
return true;
}
示例4: CalEquipElementProperty
bool NFCEquipPropertyModule::CalEquipElementProperty(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();
/////////////element/////////////////////////////////////////
const std::string& strEquipConfig = pBagRecord->GetString(nRow, NFrame::Player::BagEquipList::ConfigID);
//const int nHeroType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::HeroTye());
const int nItemType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemType());
const int nItemSubType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemSubType());
if (nItemType != NFMsg::EItemType::EIT_EQUIP)
{
return false;
}
for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i)
{
xDataList.AddInt(0);
}
//conditional the item type to define what property to give
double dwCoefficientAtk = 2.0;
double dwCoefficientDef = 1.0;
int nFireLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel1_FIRE);
int nLightLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel2_LIGHT);
int nWindLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel3_Wind);
int nIceLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel4_ICE);
int nPoisonLevel = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::ElementLevel5_POISON);
int nWindValue = nWindLevel * nWindLevel;
int nFireValue = nFireLevel * nFireLevel;
int nLightValue = nLightLevel * nLightLevel;
int nIceValue = nIceLevel * nIceLevel;
int nPoisonValue = nPoisonLevel * nPoisonLevel;
if (nItemSubType == NFMsg::EGameEquipSubType::EQUIPTYPE_WEAPON)
{
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nWindValue * dwCoefficientAtk);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nFireValue * dwCoefficientAtk);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nLightValue * dwCoefficientAtk);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nIceValue * dwCoefficientAtk);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nPoisonValue * dwCoefficientAtk);
}
else
{
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nWindValue * dwCoefficientDef);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nFireValue * dwCoefficientDef);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nLightValue * dwCoefficientDef);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nIceValue * dwCoefficientDef);
xDataList.SetInt(NFrame::Player::CommValue::ATK_FIRE, nPoisonValue * dwCoefficientDef);
}
return true;
return true;
}
示例5: CalEquipIntensifyProperty
bool NFCEquipPropertyModule::CalEquipIntensifyProperty(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/////////////////////////////////////////
const int nIntensify = pBagRecord->GetInt32(nRow, NFrame::Player::BagEquipList::IntensifyLevel);
if (nIntensify <= 0)
{
return false;
}
const std::string& strEquipConfig = pBagRecord->GetString(nRow, NFrame::Player::BagEquipList::ConfigID);
//const int nHeroType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::HeroTye());
const int nItemType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemType());
const int nItemSubType = m_pElementModule->GetPropertyInt32(strEquipConfig, NFrame::Item::ItemSubType());
if (nItemType != NFMsg::EItemType::EIT_EQUIP)
{
return false;
}
for (int i = 0; i < pCommPropertyValueRecord->GetCols(); ++i)
{
xDataList.AddInt(0);
}
//conditional the item type to define what property to give
double dwCoefficientAtk = 2.0;
double dwCoefficientDef = 1.0;
int nMAXHPValue = nIntensify * nIntensify;
int nAttackValue = nIntensify * nIntensify;
int nDefValue = nIntensify * nIntensify;
if (nItemSubType == NFMsg::EGameEquipSubType::EQUIPTYPE_WEAPON)
{
nAttackValue *= dwCoefficientAtk;
}
else
{
nDefValue *= dwCoefficientDef;
}
xDataList.SetInt(NFrame::Player::CommValue::MAXHP, nMAXHPValue);
xDataList.SetInt(NFrame::Player::CommValue::ATK_VALUE, nAttackValue);
xDataList.SetInt(NFrame::Player::CommValue::DEF_VALUE, nDefValue);
return true;
}
示例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;
}