Class EntityMovedEvent

java.lang.Object
java.util.EventObject
de.gurkenlabs.litiengine.entities.EntityMovedEvent
All Implemented Interfaces:
Serializable

public class EntityMovedEvent extends EventObject
Event dispatched whenever an IMobileEntity moves. Carries the moved entity along with the X / Y delta and the resulting travelled distance.
See Also:
  • Constructor Details

    • EntityMovedEvent

      public EntityMovedEvent(IMobileEntity entity, double deltaX, double deltaY)
      Constructs a new EntityMovedEvent.
      Parameters:
      entity - the moved entity
      deltaX - the X delta of the movement
      deltaY - the Y delta of the movement
  • Method Details

    • getEntity

      public IMobileEntity getEntity()
      Gets the entity that moved.
      Returns:
      the moved entity
    • getDeltaX

      public double getDeltaX()
      Gets the X delta of the movement.
      Returns:
      the X delta
    • getDeltaY

      public double getDeltaY()
      Gets the Y delta of the movement.
      Returns:
      the Y delta
    • getDistance

      public double getDistance()
      Gets the travelled Euclidean distance.
      Returns:
      the distance