|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.lib.properties.ProximityProperty
A utility class that you can use if you want a property that automatically registers a proximity hook to its object, when the object is placed in a map. The proximity hook will follow the object around as it moves in the map (or to other maps).
Field Summary |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Constructor Summary | |
ProximityProperty()
|
Method Summary | |
java.lang.Object |
createClone()
Clones this property. |
abstract java.lang.String[] |
getHookNames()
|
abstract Rectangle |
getProximityRect()
|
GameObject |
getTarget()
Returns the NPC we're attached to. |
abstract void |
hookEvent(java.lang.String hookName,
GameObject target,
CommandEvent data)
The desired event has taken place within the specified range of the target that was passed to GameMap.addProximityHook(). |
void |
notifyAdd(PropertyList obj)
Notifies the property it's been added to the target. |
void |
notifyRemove(PropertyList obj)
Notifies the property it's been removed from the monster. |
void |
targetEnteredMap(MapChangeEvent event)
Notification that the target object has entered a map. |
void |
targetLeftMap(MapChangeEvent event)
Notification that the target object has left its map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ProximityProperty()
Method Detail |
public abstract java.lang.String[] getHookNames()
public abstract Rectangle getProximityRect()
public abstract void hookEvent(java.lang.String hookName, GameObject target, CommandEvent data)
ProximityCallback
The callback object should be careful not to do too much processing on the calling thread. However, it's useful to note that when this method is called, the ProximityCallback object has the map-exclusive and can make changes to the map. This isn't true if it pushes the processing onto another thread.
hookEvent
in interface ProximityCallback
hookName
- the name of the hook (e.g. "sayPostHook") that's
being run.target
- the object near which the event took place.data
- the eventpublic void notifyAdd(PropertyList obj)
notifyAdd
in interface AddRemoveNotify
obj
- the monster to add the property topublic void notifyRemove(PropertyList obj)
notifyRemove
in interface AddRemoveNotify
obj
- the PropertyList we're being removed frompublic void targetEnteredMap(MapChangeEvent event)
targetEnteredMap
in interface MapChangeListener
public void targetLeftMap(MapChangeEvent event)
targetLeftMap
in interface MapChangeListener
public GameObject getTarget()
public java.lang.Object createClone()
createClone
in interface MutableProperty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |