| 16 | m_endIdSpace(endIdSpace) {} |
| 17 | |
| 18 | EntityId EntityMap::reserveEntityId() { |
| 19 | if (m_spatialMap.size() >= (size_t)(m_endIdSpace - m_beginIdSpace)) |
| 20 | throw EntityMapException("No more entity id space in EntityMap::reserveEntityId"); |
| 21 | |
| 22 | EntityId id = m_nextId; |
| 23 | while (m_spatialMap.contains(id)) |
| 24 | id = cycleIncrement(id, m_beginIdSpace, m_endIdSpace); |
| 25 | m_nextId = cycleIncrement(id, m_beginIdSpace, m_endIdSpace); |
| 26 | |
| 27 | return id; |
| 28 | } |
| 29 | |
| 30 | Maybe<EntityId> EntityMap::maybeReserveEntityId(EntityId entityId) { |
| 31 | if (m_spatialMap.size() >= (size_t)(m_endIdSpace - m_beginIdSpace)) |
no test coverage detected