本文整理汇总了C++中NF_SHARE_PTR::QueryRow方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::QueryRow方法的具体用法?C++ NF_SHARE_PTR::QueryRow怎么用?C++ NF_SHARE_PTR::QueryRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::QueryRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnObjectRecordEvent
int NFCPropertyTrailModule::OnObjectRecordEvent(const NFGUID& self, const RECORD_EVENT_DATA& xEventData, const NFIDataList::TData& oldVar, const NFIDataList::TData& newVar)
{
std::ostringstream stream;
NF_SHARE_PTR<NFIRecord> xRecord = m_pKernelModule->FindRecord(self, xEventData.strRecordName);
if (nullptr == xRecord)
{
return 0;
}
switch (xEventData.nOpType)
{
case NFIRecord::RecordOptype::Add:
{
NFCDataList xDataList;
bool bRet = xRecord->QueryRow(xEventData.nRow, xDataList);
if (bRet)
{
stream << " Trail Add Row[" << xEventData.nRow << "]";
for (int j = 0; j < xDataList.GetCount(); ++j)
{
stream << " [" << j << "] " << xDataList.StringValEx(j);
}
m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(), __FUNCTION__, __LINE__);
}
}
break;
case NFIRecord::RecordOptype::Del:
{
stream << " Trail Del Row[" << xEventData.nRow << "]";
m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(), __FUNCTION__, __LINE__);
}
break;
case NFIRecord::RecordOptype::Swap:
{
stream << " Trail Swap Row[" << xEventData.nRow << "] Row[" << xEventData.nCol << "]";
m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(), __FUNCTION__, __LINE__);
}
break;
case NFIRecord::RecordOptype::Create:
break;
case NFIRecord::RecordOptype::Update:
{
stream << " Trail UpData Row[" << xEventData.nRow << "] Col[" << xEventData.nCol << "]";
stream << " [Old] " << oldVar.StringValEx();
stream << " [New] " << newVar.StringValEx();
m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(), __FUNCTION__, __LINE__);
}
break;
case NFIRecord::RecordOptype::Cleared:
break;
case NFIRecord::RecordOptype::Sort:
break;
default:
break;
}
return 0;
}
示例2: AddHeroExp
bool NFCHeroModule::AddHeroExp(const NFGUID& self, const NFGUID& xHeroID, const int64_t nExp)
{
NF_SHARE_PTR<NFIRecord> pHeroRecord = m_pKernelModule->FindRecord(self, NFrame::Player::PlayerHero::ThisName());
if (nullptr == pHeroRecord.get())
{
return false;
}
if (xHeroID.IsNull())
{
return false;
}
if (nExp <= 0)
{
return false;
}
int nRow = pHeroRecord->FindObject(NFrame::Player::PlayerHero::GUID, xHeroID);
if (nRow < 0)
{
return false;
}
NFDataList varRowData;
if (!pHeroRecord->QueryRow(nRow, varRowData))
{
return false;
}
const int64_t nCurExp = varRowData.Int(NFrame::Player::PlayerHero::Exp);
const int nBeforeLevel = varRowData.Int32(NFrame::Player::PlayerHero::Level);
int64_t nLeftExp = nCurExp + nExp;
int nAfterLevel = nBeforeLevel;
for (int i = nBeforeLevel; i < ECONSTDEFINE_HERO_MAXLEVEL; i++)
{
const int64_t nNeedExp = (i + 1) * ECONSTDEFINE_HERO_ONCELEVEEXP;
if (nLeftExp >= nNeedExp)
{
nAfterLevel += 1;
nLeftExp -= nNeedExp;
pHeroRecord->SetInt(nRow, NFrame::Player::PlayerHero::Level, nAfterLevel);
}
else
{
break;
}
}
pHeroRecord->SetInt(nRow, NFrame::Player::PlayerHero::Exp, nLeftExp);
return true;
}
示例3: LogObjectData
int NFCPropertyTrailModule::LogObjectData(const NFGUID& self)
{
NF_SHARE_PTR<NFIObject> xObject = m_pKernelModule->GetObject(self);
if (nullptr == xObject)
{
return -1;
}
NF_SHARE_PTR<NFIPropertyManager> xPropertyManager = xObject->GetPropertyManager();
if (nullptr != xPropertyManager)
{
NF_SHARE_PTR<NFIProperty> xProperty = xPropertyManager->First();
while (nullptr != xProperty)
{
std::ostringstream stream;
stream << " Start trail ";
stream << xProperty->ToString();
m_pLogModule->LogProperty(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xProperty->GetKey(), stream.str(), __FUNCTION__, __LINE__);
xProperty = xPropertyManager->Next();
}
}
NF_SHARE_PTR<NFIRecordManager> xRecordManager = xObject->GetRecordManager();
if (nullptr != xRecordManager)
{
NF_SHARE_PTR<NFIRecord> xRecord = xRecordManager->First();
while (nullptr != xRecord)
{
for (int i = 0; i < xRecord->GetRows(); ++i)
{
NFCDataList xDataList;
bool bRet = xRecord->QueryRow(i, xDataList);
if (bRet)
{
std::ostringstream stream;
stream << " Start trail Row[" << i << "]";
for (int j = 0; j < xDataList.GetCount(); ++j)
{
stream << " [" << j << "] " << xDataList.StringValEx(j);
}
m_pLogModule->LogRecord(NFILogModule::NF_LOG_LEVEL::NLL_INFO_NORMAL, self, xRecord->GetName(), stream.str(), __FUNCTION__, __LINE__);
}
}
xRecord = xRecordManager->Next();
}
}
return 0;
}