| 28 | } |
| 29 | |
| 30 | Maybe<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 | |
| 40 | EntityId EntityMap::reserveEntityId(EntityId entityId) { |
| 41 | if (entityId == NullEntityId) |