Interface MovementListener
- All Known Implementing Classes:
Block
,DamagingArea
,LifeDrainArea
,MessagingArea
,OccupantArea
,OnePlayerArea
public interface MovementListener
Objects that monitor being moved over an area in a zone.
NOTE: This does not currently handle enter/exit situations where an entity
does not "walk" (e.g. teleported, signon/off).
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeMove(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY, int newX, int newY)
Invoked before an entity moves while over the object area.getArea()
Get the area that this object occupies.void
onEntered(ActiveEntity entity, StendhalRPZone zone, int newX, int newY)
Invoked when an entity enters the object area.void
onExited(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY)
Invoked when an entity leaves the object area.void
onMoved(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY, int newX, int newY)
Invoked when an entity moves while over the object area.
-
Method Details
-
getArea
Rectangle2D getArea()Get the area that this object occupies.- Returns:
- Rectange2D
-
onEntered
Invoked when an entity enters the object area.- Parameters:
entity
- The entity that moved.zone
- The new zone.newX
- The new X coordinate.newY
- The new Y coordinate.
-
onExited
Invoked when an entity leaves the object area.- Parameters:
entity
- The entity that entered.zone
- The old zone.oldX
- The old X coordinate.oldY
- The old Y coordinate.
-
beforeMove
Invoked before an entity moves while over the object area.- Parameters:
entity
- The entity that left.zone
- The zone.oldX
- The old X coordinate.oldY
- The old Y coordinate.newX
- The new X coordinate.newY
- The new Y coordinate.
-
onMoved
Invoked when an entity moves while over the object area.- Parameters:
entity
- The entity that left.zone
- The zone.oldX
- The old X coordinate.oldY
- The old Y coordinate.newX
- The new X coordinate.newY
- The new Y coordinate.
-