|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.monsters.Talker.Response
Keeps track of the response(s) to a given subject.
Field Summary | |
protected int |
chance_
Chance that a response will come back at all - only used for combat messages. |
protected boolean |
combat_
"combat" means this is a combat message |
protected boolean |
cycle_
|
protected int |
cycleIndex_
|
protected boolean |
default_
"default" means this is the default response if the topic they typed in doesn't have a match in our subject list. |
protected boolean |
nosubject_
"nosubject" means they just typed "talk" or "talk to |
protected boolean |
random_
|
protected java.util.ArrayList |
replies_
|
protected java.util.ArrayList |
subjects_
|
Constructor Summary | |
Talker.Response()
|
Method Summary | |
void |
addCyclicResponse(java.lang.String response,
boolean nosay)
Adds a response to cycle through - responses are cycled though in the order they're added. |
void |
addRandomResponse(java.lang.String response,
boolean nosay)
Adds a random response to be chosen from a list. |
void |
addSubject(java.lang.String name)
Adds a subject for this response. |
boolean |
containsReply(java.lang.String reply)
Returns true if we have this reply in our list already. |
int |
getChance()
|
java.util.List |
getReplies()
Returns the list of replies for this topic; only non-null if it's random or cyclic. |
java.lang.String |
getResponse()
Returns the response. |
Talker.Reply |
getSingleReply()
For topics/subjects where there is only one reply, writeData() needs to get to the Reply object. |
java.util.List |
getSubjects()
Returns the list of subjects for this topic. |
boolean |
isCombat()
|
boolean |
isCyclic()
|
boolean |
isDefault()
|
boolean |
isNoSay(java.lang.String reply)
Returns true if "no-say" is active for this reply. |
boolean |
isNoSubject()
|
boolean |
isRandom()
|
boolean |
removeReply(java.lang.String reply)
Removes a reply from this Response object. |
void |
setChance(int chance)
Sets the percentage chance that there will be a response. |
void |
setCombat()
|
void |
setDefault()
|
void |
setNoSay(java.lang.String reply,
boolean nosay)
Sets no-say for the given reply. |
void |
setNoSubject()
|
void |
setResponse(java.lang.String response,
boolean nosay)
Sets the (only) response for this topic. |
java.lang.String |
toString()
For debugging. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int cycleIndex_
protected boolean random_
protected boolean cycle_
protected java.util.ArrayList subjects_
protected java.util.ArrayList replies_
protected boolean nosubject_
protected boolean default_
protected boolean combat_
protected int chance_
Constructor Detail |
public Talker.Response()
Method Detail |
public java.lang.String getResponse()
public void setResponse(java.lang.String response, boolean nosay)
response
- the response to addpublic void addSubject(java.lang.String name)
public java.util.List getSubjects()
public java.util.List getReplies()
public boolean removeReply(java.lang.String reply)
reply
- the reply to remove
public boolean containsReply(java.lang.String reply)
public boolean isNoSay(java.lang.String reply)
public void setNoSay(java.lang.String reply, boolean nosay)
public void addRandomResponse(java.lang.String response, boolean nosay)
response
- the response to addpublic void addCyclicResponse(java.lang.String response, boolean nosay)
response
- the response to addpublic void setChance(int chance)
public int getChance()
public boolean isRandom()
public boolean isCyclic()
public void setNoSubject()
public void setDefault()
public void setCombat()
public boolean isDefault()
public boolean isNoSubject()
public boolean isCombat()
public Talker.Reply getSingleReply()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |