public class MovementController<T extends IMobileEntity> extends java.lang.Object implements IMovementController
| Constructor and Description |
|---|
MovementController(T mobileEntity) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Force force) |
void |
attach() |
void |
detach() |
java.util.List<Force> |
getActiveForces() |
T |
getEntity() |
protected boolean |
isMovementAllowed() |
protected void |
moveEntity(double deltaX,
double deltaY) |
void |
onMoved(java.util.function.Consumer<java.awt.geom.Point2D> cons) |
void |
onMovementCheck(java.util.function.Predicate<IMobileEntity> predicate) |
void |
update()
This method is called by the game loop on all objects that need to update
their attributes.
|
public MovementController(T mobileEntity)
public void attach()
attach in interface IEntityControllerpublic void detach()
detach in interface IEntityControllerpublic void apply(Force force)
apply in interface IMovementControllerpublic java.util.List<Force> getActiveForces()
getActiveForces in interface IMovementControllerpublic T getEntity()
getEntity in interface IEntityProviderpublic void onMovementCheck(java.util.function.Predicate<IMobileEntity> predicate)
onMovementCheck in interface IMovementControllerpublic void update()
IUpdateableupdate in interface IUpdateablepublic void onMoved(java.util.function.Consumer<java.awt.geom.Point2D> cons)
onMoved in interface IMovementControllerprotected void moveEntity(double deltaX,
double deltaY)
protected boolean isMovementAllowed()