Class BehaviourAction
java.lang.Object
games.stendhal.server.entity.npc.action.BehaviourAction
- All Implemented Interfaces:
ChatAction
,PostTransitionAction
BehaviourAction handles Behaviour requests.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBehaviourAction(Behaviour behaviour, String userAction, String npcAction)
Behaviour action -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
fire(Player player, Sentence sentence, EventRaiser npc)
does some action after a transition.void
fireRequestError(ItemParserResult res, Player player, Sentence sentence, EventRaiser npc)
The user input was parsed as valid Sentence, but could not transformed into a Behaviour request.abstract void
fireRequestOK(ItemParserResult res, Player player, Sentence sentence, EventRaiser npc)
The user input was parsed as a behaviour request.void
fireSentenceError(Player player, Sentence sentence, EventRaiser npc)
The user input could not be parsed in a valid Sentence.int
hashCode()
toString()
-
Field Details
-
behaviour
-
userAction
-
npcAction
-
-
Constructor Details
-
BehaviourAction
Behaviour action- Parameters:
behaviour
- behaviouruserAction
- user actionnpcAction
- npc action
-
-
Method Details
-
fireRequestError
public void fireRequestError(ItemParserResult res, Player player, Sentence sentence, EventRaiser npc)The user input was parsed as valid Sentence, but could not transformed into a Behaviour request. fireRequestError() should inform the player about the problem. -
toString
-
fire
Description copied from interface:PostTransitionAction
does some action after a transition.- Specified by:
fire
in interfaceChatAction
- Specified by:
fire
in interfacePostTransitionAction
- Parameters:
player
- player who caused the transitionsentence
- text he/she saidnpc
- the NPC doing the transition
-
fireSentenceError
The user input could not be parsed in a valid Sentence. fireSentenceError() should inform the player about the problem.- Parameters:
player
-sentence
-npc
-
-
fireRequestOK
public abstract void fireRequestOK(ItemParserResult res, Player player, Sentence sentence, EventRaiser npc)The user input was parsed as a behaviour request. fireRequestOK() should check the request and execute an action as appropriate.- Parameters:
res
-player
-sentence
-npc
-
-
hashCode
public int hashCode() -
equals
-