MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / maybeReserveEntityId

Method maybeReserveEntityId

source/game/StarEntityMap.cpp:30–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30Maybe<EntityId> EntityMap::maybeReserveEntityId(EntityId entityId) {
31 if (m_spatialMap.size() >= (size_t)(m_endIdSpace - m_beginIdSpace))
32 throw EntityMapException("No more entity id space in EntityMap::reserveEntityId");
33
34 if (entityId == NullEntityId || m_spatialMap.contains(entityId))
35 return {};
36 else
37 return entityId;
38}
39
40EntityId EntityMap::reserveEntityId(EntityId entityId) {
41 if (entityId == NullEntityId)

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected