public interface IMovementController extends IEntityController
Modifier and Type | Method and Description |
---|---|
void |
apply(Force force)
Apply the force to the entity.
|
java.util.List<Force> |
getActiveForces()
Gets the active forces.
|
float |
getDx()
Gets the delta x for each horizontal movement.
|
float |
getDy()
Sets the delta y for each vertical movement.
|
Force |
getForce(java.lang.String identifier) |
void |
onMoved(java.util.function.Consumer<java.awt.geom.Point2D> cons)
Calls given logic after the entity has been moved.
|
void |
onMovementCheck(java.util.function.Predicate<IMobileEntity> predicate)
Checks given conditions before moving.
|
void |
setDx(float dx)
Gets the delta x for each horizontal movement.
|
void |
setDy(float dy)
Sets the delta y for each vertical movement.
|
attach, detach, getEntity
update
float getDx()
void setDx(float dx)
dx
- the new dxfloat getDy()
void setDy(float dy)
dy
- the new dyvoid apply(Force force)
force
- the force being applied to the entityjava.util.List<Force> getActiveForces()
Force getForce(java.lang.String identifier)
void onMovementCheck(java.util.function.Predicate<IMobileEntity> predicate)
predicate
- the conditions that need to apply before moving. If they don't apply, the entity won't be moved.void onMoved(java.util.function.Consumer<java.awt.geom.Point2D> cons)
cons
- the logic that will be called after the entity has been moved.