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 Details

    • getArea

      Rectangle2D getArea()
      Get the area that this object occupies.
      Returns:
      Rectange2D
    • onEntered

      void onEntered(ActiveEntity entity, StendhalRPZone zone, int newX, int newY)
      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

      void onExited(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY)
      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

      void beforeMove(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY, int newX, int newY)
      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

      void onMoved(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY, int newX, int newY)
      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.