|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.autobag.AutobagRule
Encapsulates a single Autobag rule, including the rule name, the conditions for activating this rule, and the bag(s) to put the items in when the rule is activated.
Constructor Summary | |
AutobagRule()
|
Method Summary | |
void |
appendBagDesc(java.lang.StringBuffer sb)
|
void |
appendConditions(java.lang.StringBuffer sb)
|
boolean |
apply(Player p,
GameObject o)
Applies the rule by placing the item into the appropriate bag, if possible. |
static java.lang.String |
encodeXMLStream(java.lang.String input)
Escapes XML characters: &, <, >. |
BagList |
getBagList()
Returns the list of destination bags for this rule. |
AutobagConditions |
getConditions()
Returns the conditions for this rule. |
java.lang.String |
getName()
Returns the name of the rule. |
boolean |
isDropRule()
Returns true if there's only one bag name in this Rule, and it's "drop item". |
boolean |
match(GameObject obj)
Returns true if the passed object passes our conditions. |
java.lang.String |
serialize()
Returns a serialized version of the rule, in a canonical format similar to how the rules are specified. |
void |
setBagList(BagList list)
Sets the list of bags we're going to insert into for this rule. |
void |
setConditions(AutobagConditions c)
|
void |
setName(java.lang.String name)
|
java.lang.String |
toString()
Pretty-prints the rule. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AutobagRule()
Method Detail |
public void setBagList(BagList list)
public void setName(java.lang.String name)
public void setConditions(AutobagConditions c)
public java.lang.String getName()
public AutobagConditions getConditions()
public boolean match(GameObject obj)
obj
- the object to consider
public BagList getBagList()
public java.lang.String toString()
public void appendBagDesc(java.lang.StringBuffer sb)
public void appendConditions(java.lang.StringBuffer sb)
public java.lang.String serialize()
public boolean apply(Player p, GameObject o)
p
- the playero
- the item
public static java.lang.String encodeXMLStream(java.lang.String input)
public boolean isDropRule()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |