|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.properties.AutoGrab
Keeps track of which item types the user automatically picks up.
Field Summary | |
protected boolean |
all_
|
protected boolean |
armor_
|
protected boolean |
food_
|
protected boolean |
magic_
|
protected boolean |
missiles_
|
protected boolean |
treasure_
|
protected boolean |
weapons_
|
Constructor Summary | |
AutoGrab()
|
Method Summary | |
static java.lang.String |
allSettings()
Returns all currently allowable settings, excluding "all" and "none". |
static void |
copy(AutoGrab src,
AutoGrab dest)
Copies the boolean properties from one to the other. |
java.lang.Object |
createClone()
Produces a clone of the property for the caller. |
void |
handleAutoGrab(Commandable agent)
Looks under the agent to try to grab stuff we like. |
boolean |
hasNoSettings()
Returns true if none of the settings are on for this object. |
static AutoGrab |
parseSettings(java.lang.String settings)
Parses the new settings. |
boolean |
predicate(GameObject obj)
Returns true if the possessor of this AutoGrab property should pick up the passed item when moving over it. |
java.lang.String |
printSettings()
Returns the current settings. |
void |
readData(org.w3c.dom.Node bean)
Initializes the object from the XML file. |
boolean |
shouldWrite()
Returns true if we should write the object at all. |
java.lang.String |
toString()
Prints a debugging string representing this object. |
java.util.List |
writeData()
Writes the object's externalized representation to the specified output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected boolean all_
protected boolean food_
protected boolean magic_
protected boolean armor_
protected boolean weapons_
protected boolean treasure_
protected boolean missiles_
Constructor Detail |
public AutoGrab()
Method Detail |
public void readData(org.w3c.dom.Node bean) throws java.lang.Exception
readData
in interface SelfExternalizable
bean
- the node representing the SelfExternalizable bean
object, which should have at least one child data node.
java.lang.Exception
public java.util.List writeData() throws java.lang.Exception
writeData
in interface SelfExternalizable
java.lang.Exception
public boolean shouldWrite()
shouldWrite
in interface SelfExternalizable
public java.lang.Object createClone()
createClone
in interface MutableProperty
public void handleAutoGrab(Commandable agent)
agent
- the player or monster with autograb settingspublic boolean predicate(GameObject obj)
predicate
in interface Predicate
obj
- the object under consideration
public java.lang.String toString()
public java.lang.String printSettings()
public static AutoGrab parseSettings(java.lang.String settings)
settings
- a string like "armor magic food weapons"public static void copy(AutoGrab src, AutoGrab dest)
src
- the "from" objectdest
- the "to" objectpublic static java.lang.String allSettings()
public boolean hasNoSettings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |