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

Method CustomDataTest

samples/sample3/Sample3Module.cpp:464–483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464void Sample3Module::CustomDataTest(const AFGUID& guid, size_t count, const uint32_t index)
465{
466 std::cout << "----------[index] time [custom data] test start----------" << std::endl;
467
468 auto pEntity = m_pKernelModule->GetEntity(guid);
469 if (nullptr == pEntity)
470 {
471 return;
472 }
473
474 if (!pEntity->FindCustomData("test") && !pEntity->AddCustomInt32("test", 0))
475 {
476 return;
477 }
478
479 std::cout << "CustomDataTest find test = " << (pEntity->FindCustomData("test") ? "true" : "false")
480 << " value = " << pEntity->GetCustomInt32("test") << std::endl;
481
482 std::cout << "----------[index] time [custom data] test end----------" << std::endl;
483}
484
485int Sample3Module::OnClassCallBackEvent(
486 const AFGUID& self, const std::string& strClassName, const ArkEntityEvent event, const AFIDataList& arg)

Callers

nothing calls this directly

Calls 4

GetEntityMethod · 0.80
FindCustomDataMethod · 0.80
AddCustomInt32Method · 0.80
GetCustomInt32Method · 0.80

Tested by

no test coverage detected