tryPopulate

final Boolean tryPopulate(GameEntity entity)

Tries to add the entity to this PhysicsEngine grid.

The entity is allowed to be added if and only if none of its units would have ended up on an incompatible cell as defined by GameEntity.PhysicalEntity.

If the entity is added, it will receive a CollidedWith message for each unit that ended up on a cell that contains units of other entities. There will be a message for each pair of units. Other entities will receive a similar CollidedWith message as well.

Return

true if the entity was added, false otherwise.

Parameters

entity

The entity to add.