wyvern.kernel.maps
Class PythonMap

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.AbstractGameMap
          extended bywyvern.kernel.maps.DenseMap
              extended bywyvern.kernel.maps.PythonMap
All Implemented Interfaces:
Container, GameMap, GameMap.UnloadMapConstants, Hookable, MethodHookable, wyvern.kernel.lighting.Obstructions, PropertyList, SelfExternalizable

public class PythonMap
extends DenseMap

Superclass of (most) python-based game maps. Has some useful utility functions that subclasses can call.

Version:
1.0, Mar 10, 2001
Author:
Steve Yegge

Nested Class Summary
 
Nested classes inherited from class wyvern.lib.GameMap
GameMap.UnloadMapConstants
 
Field Summary
protected  java.util.HashSet monsterCache_
           
 
Fields inherited from class wyvern.kernel.maps.DenseMap
addRemoveListeners_, cachedBounds_, count_, lighting_, objects_, outOfBoundsTerrain_, size_
 
Fields inherited from class wyvern.kernel.maps.AbstractGameMap
ambient_, changeList_, commands_, dark_, defaultTerrain_, dense_, dirtyRegions_, lights_, locals_, mapHooks_, monsters_, name_, opaqueMap_, path_, perPlayer_, players_, proxHooks_, roomHooks_, suspended_, suspendTime_, suspendTimer_, teleporters_, unloadImmediately_, unloading_, visUpdates_, vpath_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.GameMap
MAX_HEIGHT, MAX_SEARCH_RADIUS, MAX_WIDTH
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Fields inherited from interface wyvern.lib.GameMap.UnloadMapConstants
MAP_CONTAINS_PLAYERS, MAP_NOT_LOADED, SUCCESS
 
Constructor Summary
PythonMap(int width, int height)
          Constructs a new PythonMap
 
Method Summary
 void addRectangle(java.lang.String arch, int x, int y, int w, int h)
          Adds a rectangle of objects to the map.
 java.util.Set getMonsterCache()
          Returns the set of monsters we found while loading the map.
 void postUserCode()
          A stub function; Wizards can put cutomization code in this method in the python map and it'll run before the objects are added.
 void preUserCode()
          A stub function; Wizards can put cutomization code in this method in the python map and it'll run before the objects are added.
 GameObject setObject(java.lang.String arch, int x, int y)
          Clones the passed archetype and puts it in this map at the specified location.
 
Methods inherited from class wyvern.kernel.maps.DenseMap
add, add, addIntensityArray, adjustIntensity, checkBounds, checkBounds, createLightMatrix, dismantle, getBounds, getLightLevel, getObjectCount, getOrCreatecell, getOutOfBoundsTerrain, getProperties, getPropertyList, getSize, initialize, initialize, isSparse, iterator, keySet, objectsAt, objectsInRect, registerAddRemoveListener, remove, remove, setOutOfBoundsTerrain, setOutOfBoundsTerrain, setSize, setTerrain, terrainAt, unregisterAddRemoveListener, visitRect
 
Methods inherited from class wyvern.kernel.maps.AbstractGameMap
addHook, addLight, addLocalArchetype, addMapLifecycleListener, addMethodHook, addMonster, addPlayer, addPlayerListener, addPropertyChangeListener, addPropertyChangeListener, addProximityHook, addRoomHook, addTeleporter, broadcast, broadcast, doneLoading, enableVisUpdates, findAt, findAt, findAt, findAt, findByName, findByName, findFreeSpot, findFreeSpot, findInRect, findTop, findTop, findTop, findUnder, fireMapLoaded, fireMapResumed, fireMapSuspended, fireMapUnloaded, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getArea, getClaim, getCommand, getDangerLevel, getDefaultTerrain, getExits, getFavorites, getHookList, getHooks, getLightingLevel, getLocalArchetype, getLocalArchetypes, getMonsterList, getMusic, getName, getObjectsAt, getPath, getPlayerList, getProfilingInfo, getPropertyChangeListeners, getPropertyChangeListeners, getProximityHookList, getResource, getRestartLoc, getRoomHookList, getStartLocation, getSuspendTime, getTerrainInfo, getTerrainRecord, getTerrainRecord, getUnloadDelay, getUpdateList, getVirtualPath, hasListeners, hasObstructions, initCommon, inMapEditor, invalidate, isBag, isEmpty, isEmpty, isInventory, isLit, isMap, isOpaque, isPerPlayer, isSuspended, isUnloaded, notifyPlayerListeners, readData, recomputeLights, registerCommand, removeFirst, removeHook, removeLight, removeLocalArchetype, removeMapLifecycleListener, removeMethodHook, removePlayer, removePlayerListener, removePropertyChangeListener, removePropertyChangeListener, removeProximityHook, removeRoomHook, removeTeleporter, resetOpaqueFlag, resetOpaqueFlag, resume, runFailedPostHook, runMethodHook, runPostHook, runPreHook, setAutoload, setDangerLevel, setDefaultTerrain, setDefaultTerrain, setFavorite, setLightingLevel, setLit, setName, setPath, setPerPlayer, setStartLocation, setTerrain, setUnloadDelay, shouldWrite, startSuspendTimer, startUnloadTimer, startUnloadTimer, suspend, toString, trackSpecialRemoves, unload, unregisterCommand, updateOpaque, updateTerrainCache, visitObjectsAt, visUpdate, wakeAllMonsters, wakeMonsters, wasAutoloaded, writeData
 
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, 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

monsterCache_

protected java.util.HashSet monsterCache_
Constructor Detail

PythonMap

public PythonMap(int width,
                 int height)
Constructs a new PythonMap

Parameters:
width - map width
height - map height
Method Detail

setObject

public GameObject setObject(java.lang.String arch,
                            int x,
                            int y)
Clones the passed archetype and puts it in this map at the specified location.


addRectangle

public void addRectangle(java.lang.String arch,
                         int x,
                         int y,
                         int w,
                         int h)
Adds a rectangle of objects to the map.

Parameters:
arch - the archetype to instantiate
x - x location
y - y location
w - rect width
h - rect height

preUserCode

public void preUserCode()
A stub function; Wizards can put cutomization code in this method in the python map and it'll run before the objects are added.


postUserCode

public void postUserCode()
A stub function; Wizards can put cutomization code in this method in the python map and it'll run before the objects are added.


getMonsterCache

public java.util.Set getMonsterCache()
Returns the set of monsters we found while loading the map.