Class SimulationCollision
java.lang.Object
dev.twilite.game.simulation.model.entity.SimulationCollision
Mutable occupancy tracker for simulated entity collision.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether an area intersects any tracked entity exceptselfId.voidclip(SimulationEntity state) Reserves the occupied area for an entity state.static SimulationCollisionfrom(Iterable<SimulationEntity> states) Creates a tracker containing the supplied entity states.voidunclip(SimulationEntity state) Removes the occupied area for an entity state.voidupdate(SimulationEntity state) Updates the reserved occupied area for an entity.
-
Constructor Details
-
SimulationCollision
public SimulationCollision()
-
-
Method Details
-
from
Creates a tracker containing the supplied entity states.- Parameters:
states- simulated entities to reserve
-
clip
Reserves the occupied area for an entity state.- Parameters:
state- entity state to reserve
-
unclip
Removes the occupied area for an entity state.- Parameters:
state- entity state to remove
-
update
Updates the reserved occupied area for an entity.- Parameters:
state- entity state to update
-
blocked
Returns whether an area intersects any tracked entity exceptselfId.- Parameters:
area- area to testselfId- entity id to ignore
-