add comments

This commit is contained in:
Andrew Meadows 2019-11-13 15:27:17 -08:00
parent de44cdaf25
commit 28f51f6204
2 changed files with 4 additions and 0 deletions

View file

@ -43,6 +43,7 @@ void EntitySimulation::updateEntities() {
}
void EntitySimulation::removeEntityFromInternalLists(EntityItemPointer entity) {
// protected: _mutex lock is guaranteed
// remove from all internal lists except _deadEntitiesToRemoveFromTree
_entitiesToSort.remove(entity);
_simpleKinematicEntities.remove(entity);
@ -144,6 +145,7 @@ void EntitySimulation::sortEntitiesThatMoved() {
}
void EntitySimulation::addEntityToInternalLists(EntityItemPointer entity) {
// protected: _mutex lock is guaranteed
if (entity->isMortal()) {
_mortalEntities.insert(entity);
uint64_t expiry = entity->getExpiry();

View file

@ -171,6 +171,8 @@ void PhysicalEntitySimulation::processChangedEntity(const EntityItemPointer& ent
}
void PhysicalEntitySimulation::processDeadEntities() {
// Note: this override is a complete rewite of the base class's method because we cannot assume all entities
// are domain entities, and the consequence of trying to delete a domain-entity in this case is very different.
if (_deadEntitiesToRemoveFromTree.empty()) {
return;
}