MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / GetEntityByDataNode

Method GetEntityByDataNode

src/plugin/kernel/src/AFCMapModule.cpp:333–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333int AFCMapModule::GetEntityByDataNode(
334 const int map_id, const std::string& name, const AFIDataList& value_args, AFIDataList& list)
335{
336 AFCDataList varObjectList;
337 GetMapOnlineList(map_id, varObjectList);
338 size_t entity_count = varObjectList.GetCount();
339 for (size_t i = 0; i < entity_count; ++i)
340 {
341 AFGUID ident = varObjectList.Int64(i);
342 auto pEntity = m_pKernelModule->GetEntity(ident);
343 if (pEntity == nullptr)
344 {
345 continue;
346 }
347
348 AFCData data;
349 if (!pEntity->GetNode(name, data))
350 {
351 continue;
352 }
353
354 if (value_args.Equal(0, data))
355 {
356 list.AddInt64(ident);
357 }
358 }
359
360 return list.GetCount();
361}
362
363} // namespace ark

Callers

nothing calls this directly

Calls 6

Int64Method · 0.80
GetEntityMethod · 0.80
AddInt64Method · 0.80
GetCountMethod · 0.45
GetNodeMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected