Class MessagingArea

All Implemented Interfaces:
MovementListener, Killer, Cloneable, Iterable<String>, Serializable

public class MessagingArea extends AreaEntity implements MovementListener
Area that sends a private message to any player entering and/or leaving it.
  • Constructor Details

    • MessagingArea

      public MessagingArea(boolean coversZone, int width, int height, String enterMessage, String leaveMessage, boolean isWarning)
      Create a MessagingArea.
      Parameters:
      coversZone - true if the area should cover the whole zone
      width - width of the area
      height - height of the area
      enterMessage - message to be sent to players entering the area
      leaveMessage - message to be sent to players leaving the area
      isWarning - set to true if the message is a warning that is especially important for the player to see
  • Method Details

    • onEntered

      public void onEntered(ActiveEntity entity, StendhalRPZone zone, int newX, int newY)
      Description copied from interface: MovementListener
      Invoked when an entity enters the object area.
      Specified by:
      onEntered in interface MovementListener
      Parameters:
      entity - The entity that moved.
      zone - The new zone.
      newX - The new X coordinate.
      newY - The new Y coordinate.
    • onExited

      public void onExited(ActiveEntity entity, StendhalRPZone zone, int newX, int newY)
      Description copied from interface: MovementListener
      Invoked when an entity leaves the object area.
      Specified by:
      onExited in interface MovementListener
      Parameters:
      entity - The entity that entered.
      zone - The old zone.
      newX - The old X coordinate.
      newY - The old Y coordinate.
    • onMoved

      public void onMoved(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY, int newX, int newY)
      Description copied from interface: MovementListener
      Invoked when an entity moves while over the object area.
      Specified by:
      onMoved in interface MovementListener
      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.
    • onAdded

      public void onAdded(StendhalRPZone zone)
      Called when this object is added to a zone.
      Overrides:
      onAdded in class AreaEntity
      Parameters:
      zone - The zone this was added to.
    • onRemoved

      public void onRemoved(StendhalRPZone zone)
      Called when this object is being removed from a zone.
      Overrides:
      onRemoved in class AreaEntity
      Parameters:
      zone - The zone this will be removed from.
    • beforeMove

      public void beforeMove(ActiveEntity entity, StendhalRPZone zone, int oldX, int oldY, int newX, int newY)
      Description copied from interface: MovementListener
      Invoked before an entity moves while over the object area.
      Specified by:
      beforeMove in interface MovementListener
      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.
    • warnPlayer

      public boolean warnPlayer()