wyvern.kernel.maps
Class Area

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.kernel.maps.Area
All Implemented Interfaces:
Broadcaster, GameObject, MethodHookable, PropertyList

public final class Area
extends MapObject

Manages information shared by collections of maps. If you put an "area.arch" file in a map directory, then all the maps automatically inherit the properties of that Area archetype. Only a certain set of properties are currently supported for an Area:

Version:
1.0, Jul 25, 2003
Author:
Steve Yegge

Field Summary
static Area MASTER_AREA
           
 
Fields inherited from class wyvern.kernel.maps.MapObject
IN_MAP_EDITOR, listenerList_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Constructor Summary
Area()
           
 
Method Summary
static Area getArea(GameMap map)
          Returns the Area object for a given map.
static Area getArea(Resource r)
          Returns the Area object for a given directory.
static Area getArea(java.lang.String path)
          Returns the Area object for a given directory.
 Music getMusic()
          Returns the default background music for this Area.
 Resource getPath()
          Returns a Resource describing the path to this Area archetype.
 java.lang.String getRestartCommand(Player player)
          Returns the path to the map the player should restart in if they die (or cast word of recall).
 Location getRestartLoc()
          Returns the restart-location for this map: where players teleport to when they die in this map.
 Location getRestartLoc(GameMap map)
          Returns the restart location for the specified map.
 void setPath(Resource path)
          Sets the path.
 java.lang.String toString()
          Returns debugging string.
 
Methods inherited from class wyvern.kernel.maps.MapObject
addContainerChangeListener, addDefaultProperty, addMapChangeListener, addMapMotionListener, addMethodHook, addMotionTracker, addObjectTracker, addPrefix, addSuffix, addToMap, bless, broadcast, broadcast, broadcast, broadcast, broadcast, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, destroy, ensureListenerList, ensureWeight, externalize, fireContainerEntered, fireContainerExited, fireEnteredMap, fireExitedMap, fireMovedInMap, getAlpha, getAppearance, getArchetype, getBaseName, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getImageDescriptors, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getTile, getValue, getWeight, groupString, inContainer, initialize, initLocs, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeFromMap, removeMapChangeListener, removeMapMotionListener, removeMethodHook, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, runMethodHook, setAlpha, setAnimated, setBitmap, setCategory, setContainer, setDefaultBitmap, setDefaultCategory, setDefaultDesc, setDefaultImage, setDefaultIntProperty, setDefaultLayer, setDefaultMaterial, setDefaultProperty, setDefaultShortDesc, setDirection, setImage, setImage, setLayer, setLocations, setMap, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport, updateMapLocation
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wyvern.lib.PropertyList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 

Field Detail

MASTER_AREA

public static final Area MASTER_AREA
Constructor Detail

Area

public Area()
Method Detail

getPath

public Resource getPath()
Returns a Resource describing the path to this Area archetype.


setPath

public void setPath(Resource path)
Sets the path. You can only do this once, after calling the no-arg constructor.


getArea

public static Area getArea(java.lang.String path)
Returns the Area object for a given directory.

Parameters:
path - the relative path to the directory. Can be the directory name ("wiz/rhialto/maps/misc" ) or any file in the directory ( "wiz/rhialto/maps/misc/foo.map").
Returns:
the Area object for that directory.

getArea

public static Area getArea(GameMap map)
Returns the Area object for a given map.


getArea

public static Area getArea(Resource r)
Returns the Area object for a given directory.

Parameters:
r - a Resource pointing to the "area.arch" file for this area. It's usually easier to call getArea(java.lang.String) if you know the directory
Returns:
the Area object.

getMusic

public Music getMusic()
Returns the default background music for this Area.

Returns:
the Soundtrack for this area. Returns null if we didn't have one.

getRestartLoc

public Location getRestartLoc(GameMap map)
Returns the restart location for the specified map. Looks in the map, then the map's Area, then returns a default location.

Parameters:
map - the map of interest
Returns:
a Location, guaranteed to be non-null and refer to an existing area.

getRestartLoc

public Location getRestartLoc()
Returns the restart-location for this map: where players teleport to when they die in this map. It should specify a chapel or save haven, preferably one that's always loaded and never resets.

Returns:
the restart location for this map. Looks in the parent Area if not specified in a "restart-loc" property on the map. Can be null, in which case the World object figures out a default restart location for the map.

getRestartCommand

public java.lang.String getRestartCommand(Player player)
Returns the path to the map the player should restart in if they die (or cast word of recall).

Parameters:
player - the player to use it on
Returns:
the path to a map, guaranteed non-null, with which you can command the player "goto "

toString

public java.lang.String toString()
Returns debugging string.

Overrides:
toString in class MapObject
Returns:
a short String describing this object. If the object represents a group of items, such as coins, the returned description will be a modified version of the description that includes quantity information.