Interface IMobileEntity

All Superinterfaces:
ICollisionEntity, IEntity
All Known Implementing Classes:
Creature

public interface IMobileEntity
extends ICollisionEntity
  • Method Details

    • onMoved

      void onMoved​(IMobileEntity.EntityMovedListener listener)
      Adds the specified entity moved listener to receive events when this entity was moved.

      In comparison to the EntityTransformListener.locationChanged(IEntity) event, this provides some additional information about the movement (e.g. distance) and is only fired if the entity instance is currently loaded.

      Parameters:
      listener - The listener to add.
    • removeMovedListener

      void removeMovedListener​(IMobileEntity.EntityMovedListener listener)
      Removes the specified entity moved listener.
      Parameters:
      listener - The listener to remove.
    • getAcceleration

      int getAcceleration()
      Gets a value that defines how long it takes the entity to reach the full velocity (in ms).
      Returns:
      the acceleration value
    • getDeceleration

      int getDeceleration()
      Gets a value that defines how long it takes the entity to stop when slowing down from movements (in ms).
      Returns:
      the deceleration value
    • getVelocity

      Attribute<java.lang.Float> getVelocity()
      Gets the entity's velocity in PIXELS per Second.
      Returns:
      the velocity in pixel per second.
    • getTickVelocity

      float getTickVelocity()
      Gets the entity's velocity in PIXELS per tick.
      Returns:
      The velocity in pixel per tick.
    • movement

      Gets the movement controller.
      Returns:
      the movement controller
    • setAcceleration

      void setAcceleration​(int acceleration)
      Sets the acceleration for this entity. Acceleration is a value that defines how long it takes the entity to reach the full velocity when starting to move (in ms). *
      Parameters:
      acceleration - the new acceleration
    • setDeceleration

      void setDeceleration​(int deceleration)
      Sets the deceleration for this entity. deceleration is a value that defines how long it takes the entity to stop when slowing down from movements (in ms).
      Parameters:
      deceleration - the new deceleration
    • setTurnOnMove

      void setTurnOnMove​(boolean turn)
      Sets the turn on move parameter for this entity. It specifies if the entity will change its angle to the direction of the move destination when moved.
      Parameters:
      turn - the new turn on move parameter.
    • setVelocity

      void setVelocity​(float velocity)
      Sets the base value on the velocity attribute of this instance.
      Parameters:
      velocity - The velocity to be set.
      See Also:
      getVelocity()
    • turnOnMove

      boolean turnOnMove()
      Gets the turn on move parameter for this entity. It specifies if the entity will change its angle to the direction of the move destination when moved.
      Returns:
      true, if the entity will change its angle to the direction of the move destination when being moved