|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.autobag.AutobagRules
A persistent list of autobag rules. Keeps a list of AutobagRule objects, and knows how to read and write them as XML in the player's property list.
Constructor Summary | |
AutobagRules()
|
Method Summary | |
void |
addHooks(Player p)
|
protected void |
considerItem(GameObject item)
Called when an item is picked up by our owner. |
void |
delete(int num)
|
AutobagRule |
getRule(int number)
Returns the rule at the specified position. |
java.util.List |
getRules()
Returns the complete set of rules. |
void |
hookEvent(java.lang.String hook,
CommandEvent e)
Called after an item is picked up. |
boolean |
isEmpty()
Returns true if there are no rules defined in this list. |
void |
notifyAdd(PropertyList list)
Notifies the property that it's being added to a PropertyList. |
void |
notifyRemove(PropertyList list)
Notifies the property that it's being removed from a PropertyList. |
void |
readData(org.w3c.dom.Node bean)
Tells the object to parse its externalized representation from a list of lines. |
void |
removeHooks(Player p)
|
boolean |
shouldWrite()
Allows the object to determine whether it wants to be written out at all. |
int |
size()
|
java.lang.String |
toString()
|
java.util.List |
writeData()
Tells the object to write its properties out to a text file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AutobagRules()
Method Detail |
public void notifyAdd(PropertyList list)
AddRemoveNotify
You should never assume that the passed value is a GameObject. Make sure to test it with instanceof (Java) or isInstance (Jython) first. Properties are added to Archetypes as well as GameObjects, so your AddRemoveNotify is likely to be called for both cases.
notifyAdd
in interface AddRemoveNotify
list
- the PropertyList whose property list we're being
added topublic void notifyRemove(PropertyList list)
AddRemoveNotify
You should never assume that the passed value is a GameObject. Make sure to test it with instanceof (Java) or isInstance (Jython) first. Properties are added to Archetypes as well as GameObjects, so your AddRemoveNotify is likely to be called for both cases.
notifyRemove
in interface AddRemoveNotify
list
- the PropertyList we're being removed frompublic void addHooks(Player p)
public void removeHooks(Player p)
public void hookEvent(java.lang.String hook, CommandEvent e)
hookEvent
in interface HookCallback
hook
- the name of the hook, such as "movePreHook".e
- the CommandEvent encapsulating the event parametersprotected void considerItem(GameObject item)
item
- the item that was picked up.public AutobagRule getRule(int number)
public java.util.List getRules()
public int size()
public void delete(int num)
public boolean isEmpty()
public void readData(org.w3c.dom.Node bean) throws java.lang.Exception
SelfExternalizable
readData
in interface SelfExternalizable
bean
- the XML DOM representation of the externalized
bean object. Its child could be a text node, in which case
the bean has to do all the parsing for the data. It could
also wrap a series of elements (e.g. archetypes), in which case
the bean may wish to leverage the XML parsing utilities that
the game provides in the ArchetypeManager.
java.lang.Exception
public java.util.List writeData() throws java.lang.Exception
SelfExternalizable
writeData
in interface SelfExternalizable
java.lang.Exception
public boolean shouldWrite()
SelfExternalizable
shouldWrite
in interface SelfExternalizable
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |