MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / findFirstEntity

Function findFirstEntity

test/algorithm/Scene.h:127–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127inline scene::INodePtr findFirstEntity(const scene::INodePtr& parent,
128 const std::function<bool(const IEntityNodePtr&)>& predicate)
129{
130 IEntityNodePtr candidate;
131
132 parent->foreachNode([&](const scene::INodePtr& node)
133 {
134 auto entity = std::dynamic_pointer_cast<IEntityNode>(node);
135
136 if (entity && predicate(entity))
137 {
138 candidate = entity;
139 return false;
140 }
141
142 return true;
143 });
144
145 return candidate;
146}
147
148inline scene::INodePtr findWorldspawn(const scene::INodePtr& root)
149{

Callers 5

findPlayerStartEntityFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
findWorldspawnFunction · 0.85
getEntityByNameFunction · 0.85

Calls 1

foreachNodeMethod · 0.45

Tested by

no test coverage detected