wyvern.lib.classes.construct
Class Wall

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.construct.ConnectedObject
              extended bywyvern.lib.classes.construct.Wall
All Implemented Interfaces:
Broadcaster, GameObject, MethodHookable, Predicate, PropertyList
Direct Known Subclasses:
DiggableWall, DisplayCase, Door, Firewall

public class Wall
extends ConnectedObject
implements Predicate

Basic wall class. Doors are a subclass.

Version:
1.0, Aug 18, 1997
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.lib.classes.construct.ConnectedObject
baseBitmapName_
 
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
Wall()
          Constructs a new Wall
 
Method Summary
 Predicate getNeighborPredicate()
          Returns a predicate that returns true if the object is a Wall or a Door.
 void initialize()
          Sets the class-default properties for this archetype.
 boolean predicate(GameObject obj)
          Predicate for checking if an object is considered a neighboring wall.
 void remove()
          Removes from map and unsets opaque bit.
 void setMap(GameMap map, int x, int y)
          Removes any existing wall or door there.
 
Methods inherited from class wyvern.lib.classes.construct.ConnectedObject
applyBitmap, checkNeighbor, doUpdate, getWallBaseName, haveNeighbor, processNeighbor, setBaseBitmap, stripDirs, teleport, updateBitmap, updateBitmapAndNeighbors
 
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, 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, 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, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, toString, 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
 

Constructor Detail

Wall

public Wall()
Constructs a new Wall

Method Detail

initialize

public void initialize()
Sets the class-default properties for this archetype. If the wall has the boolean property "nojoin", it will only connect with other walls of exactly the same class. If the wall has the boolean property "noconnect", it will never connect to other walls, even of the same type.

Specified by:
initialize in interface GameObject
Overrides:
initialize in class ConnectedObject

setMap

public void setMap(GameMap map,
                   int x,
                   int y)
Removes any existing wall or door there.

Specified by:
setMap in interface GameObject
Overrides:
setMap in class ConnectedObject
Parameters:
map - game map
x - map x
y - map y

remove

public void remove()
Removes from map and unsets opaque bit.

Specified by:
remove in interface GameObject
Overrides:
remove in class ConnectedObject

getNeighborPredicate

public Predicate getNeighborPredicate()
Returns a predicate that returns true if the object is a Wall or a Door.

Specified by:
getNeighborPredicate in class ConnectedObject
Returns:
a predicate returning true for valid neighbors

predicate

public boolean predicate(GameObject obj)
Predicate for checking if an object is considered a neighboring wall. If the wall has "noconnect" set, it never connects to any other wall. If it has the "nojoin" property, it will only connect to other walls of it's "join-type". All walls with the same "join-type" property (not set by default) will join together. So walls without a "join-type" set will join with other types that also don't have "join-type" set.

This used to be a standalone helper class, but we allocate tens of thousands of wall objects in the game, so making it a function instead is good for performance.

Specified by:
predicate in interface Predicate
Parameters:
obj - any GameObject
Returns:
true if the object passes, else false