MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getObjectId

Function getObjectId

src/OpenLoco/src/Objects/ObjectManager.cpp:612–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610 }
611
612 static LoadedObjectId getObjectId(LoadedObjectIndex index)
613 {
614 size_t objectType = 0;
615 while (objectType < kMaxObjectTypes)
616 {
617 auto count = getMaxObjects(static_cast<ObjectType>(objectType));
618 if (index < count)
619 {
620 return static_cast<LoadedObjectId>(index);
621 }
622 index -= count;
623 objectType++;
624 }
625 return kNullObjectId;
626 }
627
628 LoadObjectsResult loadAll(std::span<ObjectHeader> objects)
629 {

Callers 1

loadAllFunction · 0.85

Calls 1

getMaxObjectsFunction · 0.85

Tested by

no test coverage detected