|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.maps.AbstractGameMap wyvern.kernel.maps.DenseMap wyvern.lib.classes.Vault
A personal, per-player storage area. Players can drop stuff in their vault and it will persist across resets. Should be instantiated via a mapfile that uses this as its map class.
Nested Class Summary | |
protected class |
Vault.VaultTimer
Receives the timer callback. |
Nested classes inherited from class wyvern.lib.GameMap |
GameMap.UnloadMapConstants |
Field Summary |
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 | |
Vault(Dimension d)
Constructs a new Vault |
Method Summary | |
void |
add(int x,
int y,
GameObject obj)
Adds an object to the map. |
void |
hookEvent(java.lang.String hookName,
CommandEvent ev)
Gives the HookCallback a chance to do something with the passed event. |
void |
remove(int x,
int y,
GameObject obj)
When the player leaves, save the vault contents. |
void |
removeBogusObjects()
Goes through all the objects in the vault and removes any that shouldn't be saved out, such as monsters. |
void |
saveVault()
Saves the vault contents to the vault file. |
void |
setTimer()
Sets a timer after the last player leaves. |
protected boolean |
wantToRemove(java.lang.Object ob)
Checks if we want to remove an object from the vault instead of saving it out. |
void |
writeVault()
Writes the vault contents on a non-kernel thread. |
Methods inherited from class wyvern.kernel.maps.DenseMap |
add, addIntensityArray, adjustIntensity, checkBounds, checkBounds, createLightMatrix, dismantle, getBounds, getLightLevel, getObjectCount, getOrCreatecell, getOutOfBoundsTerrain, getProperties, getPropertyList, getSize, initialize, initialize, isSparse, iterator, keySet, objectsAt, objectsInRect, registerAddRemoveListener, remove, setOutOfBoundsTerrain, setOutOfBoundsTerrain, setSize, setTerrain, terrainAt, unregisterAddRemoveListener, visitRect |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Vault(Dimension d)
Method Detail |
public void add(int x, int y, GameObject obj)
add
in interface GameMap
add
in class DenseMap
x
- map x locationy
- map y locationobj
- the object to addpublic void remove(int x, int y, GameObject obj)
remove
in interface GameMap
remove
in class DenseMap
x
- map x locationy
- map y locationobj
- the object reference to remove. Does nothing if
the specified obj reference isn't found at (x, y).public void setTimer()
public void saveVault()
public void writeVault()
public void removeBogusObjects()
protected boolean wantToRemove(java.lang.Object ob)
ob
- a GameObject in the vault
public void hookEvent(java.lang.String hookName, CommandEvent ev)
hookEvent
in interface HookCallback
hookName
- the name of the hook, such as "movePreHook".ev
- the CommandEvent encapsulating the event parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |