Class ZoneAttributes

java.lang.Object
games.stendhal.server.core.engine.ZoneAttributes

public class ZoneAttributes extends Object
A container for arbitrary map attributes.
  • Constructor Details

    • ZoneAttributes

      public ZoneAttributes(StendhalRPZone zone)
      Create new ZoneAttributes.
      Parameters:
      zone - the zone for which the attribute set is created
  • Method Details

    • setBaseName

      public final void setBaseName(String name)
      Set the base name of the layers in the zone. Normally you do not need to call this, as the name is got from the zone. Setting it is necessary if the zone name does not match the base name of the tile layers, as is in the case of special zones like the bank vault. For those zones the base name comes from the parent zone used to create the special zone, and the name must be set to the same for the attributes layer.
      Parameters:
      name - base zone name
    • getZone

      public StendhalRPZone getZone()
      Get the zone where these attributes belong to.
      Returns:
      zone
    • put

      public void put(String key, String value)
      Set an attribute.
      Parameters:
      key -
      value -
    • get

      public String get(String key)
      Get the current value of an attribute.
      Parameters:
      key - attribute key
      Returns:
      attribute value, or null if the attribute is not set
    • remove

      public void remove(String key)
      Remove an attribute.
      Parameters:
      key - attribute name
    • putAll

      public void putAll(Map<String,​String> map)
      Set all attributes.
      Parameters:
      map - map of attributes