Class AreaEntity

All Implemented Interfaces:
Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
Allotment, BlockTarget, ConditionAndActionArea, CreatureProtectionArea, GameBoard, MessagingArea, OccupantArea, OnePlayerArea, SokobanBoard, TargetMarker, TiledArea, WalkBlocker, Wall

public class AreaEntity extends Entity
A base area entity.
  • Field Details

  • Constructor Details

    • AreaEntity

      public AreaEntity()
      Creates a one by one area entity.
    • AreaEntity

      public AreaEntity(int width, int height)
      Create an area entity.
      Parameters:
      width - Width of this area
      height - Height of this area
  • Method Details

    • generateRPClass

      public static void generateRPClass()
      Generate the RPClass (compatible with manual init/order). NOTE: This MUST be called during environment initialization.
    • getName

      public String getName()
      Get the entity name.
      Specified by:
      getName in interface Killer
      Overrides:
      getName in class Entity
      Returns:
      The entity's name, or null if undefined.
    • setName

      public void setName(String name)
      Set the name.
      Parameters:
      name - The area name.
    • getDescriptionName

      public String getDescriptionName(boolean definite)
      Returns the name or something that can be used to identify the entity for the player.
      Overrides:
      getDescriptionName in class Entity
      Parameters:
      definite - true for "the", and false for "a/an" in case the entity has no name.
      Returns:
      The description name.
    • getTitle

      public String getTitle()
      Get the nicely formatted entity title/name.
      Overrides:
      getTitle in class Entity
      Returns:
      The title, or null if unknown.
    • addBehaviour

      public void addBehaviour(AreaBehaviour behaviour)
      adds a Behaviour to this area
      Parameters:
      behaviour - behaviour to add
    • onAdded

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

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