MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / create

Method create

Source/Entity/Entity.cpp:338–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338Entity* Entity::create() {
339 auto& entities = SharedEntityPool.entities;
340 auto& usedIndices = SharedEntityPool.usedIndices;
341 auto& availableEntities = SharedEntityPool.availableEntities;
342 if (!availableEntities.empty()) {
343 Ref<Entity> entity = availableEntities.top();
344 availableEntities.pop();
345 entities[entity->getIndex()] = entity;
346 usedIndices.insert(entity->getIndex());
347 return entity;
348 }
349 Entity* entity = Object::createNotNull<Entity>(s_cast<int>(entities.size()));
350 entities.push_back(entity);
351 usedIndices.insert(entity->getIndex());
352 return entity;
353}
354
355int Entity::getComIndex(String name) {
356 return SharedEntityPool.getIndex(name);

Callers

nothing calls this directly

Calls 15

topMethod · 0.80
popMethod · 0.65
insertMethod · 0.65
findMethod · 0.65
toStringMethod · 0.65
sortFunction · 0.50
createFunction · 0.50
format_toFunction · 0.50
to_stringFunction · 0.50
emptyMethod · 0.45
getIndexMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected