本文整理汇总了C++中NFDataList::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ NFDataList::Append方法的具体用法?C++ NFDataList::Append怎么用?C++ NFDataList::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NFDataList
的用法示例。
在下文中一共展示了NFDataList::Append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateSceneNPC
bool NFCSceneAOIModule::CreateSceneNPC(const int nSceneID, const int nGroupID, const NFDataList& argList)
{
NF_SHARE_PTR<NFCSceneInfo> pSceneInfo = GetElement(nSceneID);
if (!pSceneInfo)
{
return false;
}
//prepare monster for player
//create monster before the player enter the scene, then we can send monster's data by one message pack
//if you create monster after player enter scene, then send monster's data one by one
NF_SHARE_PTR<SceneSeedResource> pResource = pSceneInfo->mtSceneResourceConfig.First();
for (; pResource; pResource = pSceneInfo->mtSceneResourceConfig.Next())
{
int nWeight = m_pKernelModule->Random(0, 100);
if (nWeight <= pResource->nWeight)
{
const std::string& strClassName = m_pElementModule->GetPropertyString(pResource->strConfigID, NFrame::IObject::ClassName());
NFDataList arg;
arg << NFrame::IObject::Position() << pResource->vSeedPos;
arg << NFrame::NPC::SeedID() << pResource->strSeedID;
arg.Append(argList);
m_pKernelModule->CreateObject(NFGUID(), nSceneID, nGroupID, strClassName, pResource->strConfigID, arg);
}
}
return false;
}
示例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;
}