本文整理汇总了C++中NFDataList::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ NFDataList::Add方法的具体用法?C++ NFDataList::Add怎么用?C++ NFDataList::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NFDataList
的用法示例。
在下文中一共展示了NFDataList::Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnObjectEntry
void NFCPlayerLogic::OnObjectEntry(const NFSOCK nSockIndex, const int nMsgID, const char* msg, const uint32_t nLen)
{
NFGUID nPlayerID;
NFMsg::AckPlayerEntryList xMsg;
if (!NFINetModule::ReceivePB(nMsgID, msg, nLen, xMsg, nPlayerID))
{
return;
}
for(int i = 0; i < xMsg.object_list_size(); i++)
{
const NFMsg::PlayerEntryInfo info = xMsg.object_list(i);
NFDataList var;
var.Add("X");
var.AddFloat(info.x());
var.Add("Y");
var.AddFloat(info.y());
var.Add("Z");
var.AddFloat(info.z());
g_pKernelModule->CreateObject(NFINetModule::PBToNF(info.object_guid()), info.scene_id(), 0, info.class_id(), info.config_id(), var);
}
}
示例2: GetBroadCastObject
int NFCSceneAOIModule::GetBroadCastObject(const NFGUID & self, const std::string & strPropertyName, const bool bTable, NFDataList & valueObject)
{
int nObjectContainerID = m_pKernelModule->GetPropertyInt32(self, NFrame::IObject::SceneID());
int nObjectGroupID = m_pKernelModule->GetPropertyInt32(self, NFrame::IObject::GroupID());
const std::string& strClassName = m_pKernelModule->GetPropertyString(self, NFrame::IObject::ClassName());
NF_SHARE_PTR<NFIRecordManager> pClassRecordManager = m_pClassModule->GetClassRecordManager(strClassName);
NF_SHARE_PTR<NFIPropertyManager> pClassPropertyManager = m_pClassModule->GetClassPropertyManager(strClassName);
NF_SHARE_PTR<NFIRecord> pRecord(NULL);
NF_SHARE_PTR<NFIProperty> pProperty(NULL);
if (bTable)
{
if (NULL == pClassRecordManager)
{
return -1;
}
pRecord = pClassRecordManager->GetElement(strPropertyName);
if (NULL == pRecord)
{
return -1;
}
}
else
{
if (NULL == pClassPropertyManager)
{
return -1;
}
pProperty = pClassPropertyManager->GetElement(strPropertyName);
if (NULL == pProperty)
{
return -1;
}
}
if (bTable)
{
//upload property can not board to itself
if (!pRecord->GetUpload())
{
if (pRecord->GetPublic())
{
m_pKernelModule->GetGroupObjectList(nObjectContainerID, nObjectGroupID, valueObject, true, self);
}
if (pRecord->GetPrivate())
{
valueObject.Add(self);
}
}
}
else
{
//upload property can not board to itself
if (!pProperty->GetUpload())
{
if (pProperty->GetPublic())
{
m_pKernelModule->GetGroupObjectList(nObjectContainerID, nObjectGroupID, valueObject, true, self);
}
if (pProperty->GetPrivate())
{
valueObject.Add(self);
}
}
}
return valueObject.GetCount();
}
示例3: 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;
}