Class EntityMovedEvent
java.lang.Object
java.util.EventObject
de.gurkenlabs.litiengine.entities.EntityMovedEvent
- All Implemented Interfaces:
Serializable
Event dispatched whenever an
IMobileEntity moves. Carries the moved entity along with the X / Y delta and the resulting travelled
distance.- See Also:
-
Field Summary
Fields inherited from class EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionEntityMovedEvent(IMobileEntity entity, double deltaX, double deltaY) Constructs a newEntityMovedEvent. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the X delta of the movement.doubleGets the Y delta of the movement.doubleGets the travelled Euclidean distance.Gets the entity that moved.Methods inherited from class EventObject
getSource, toString
-
Constructor Details
-
EntityMovedEvent
Constructs a newEntityMovedEvent.- Parameters:
entity- the moved entitydeltaX- the X delta of the movementdeltaY- the Y delta of the movement
-
-
Method Details
-
getEntity
-
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
-