Class Area

java.lang.Object
games.stendhal.server.util.Area
Direct Known Subclasses:
TrainingArea

public class Area extends Object
An area is a specified place on a specified zone like (88, 78) to (109, 98) in 0_ados_wall_n.
Author:
hendrik
  • Constructor Details

    • Area

      public Area(StendhalRPZone zone, Rectangle2D shape)
      Creates a new Area.
      Parameters:
      zone - name of the map
      shape - shape on that map
    • Area

      public Area(StendhalRPZone zone, int x, int y, int width, int height)
      Creates a new Area.
      Parameters:
      zone - name of the map
      x - x
      y - y
      width - width
      height - height
  • Method Details

    • contains

      public boolean contains(Entity entity)
      Checks whether an entity is in this area (e. g. on this zone and inside of the shape)
      Parameters:
      entity - An entity to check
      Returns:
      true, if and only if the entity is in this area.
    • contains

      public boolean contains(CreatureRespawnPoint point)
      Checks whether a respawn point is within this area.
      Parameters:
      point - the point to examine
      Returns:
      true if the point is within this area, false otherwise
    • getShape

      public Shape getShape()
      Gets the shape.
      Returns:
      shape
    • getPlayers

      public List<Player> getPlayers()
      Gets a list of players in the area.
      Returns:
      A list of all players in the area.
    • getZone

      public StendhalRPZone getZone()
      gets the zone
      Returns:
      StendhalRPZone
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object