Package games.stendhal.server.entity.npc

Examples of games.stendhal.server.entity.npc.ConversationStates


  private boolean matchesTransition(final MatchType type, final Sentence sentence, final Transition transition) {
    return type.match(transition, currentState, sentence);
  }

  private void executeTransition(final Player player, final Sentence sentence, final Transition trans) {
    final ConversationStates nextState = trans.getNextState();

    if (trans.getReply() != null) {
      speakerNPC.say(trans.getReply());
    }
View Full Code Here


   * Tests for addSingleStringEmptyCondition.
   */
  @Test
  public void testAddSingleStringEmptyCondition() {
    final Engine en = new Engine(new SpeakerNPC("bob"));
    ConversationStates state = IDLE;

    final String triggers = "boo";

    final ConversationStates nextState = ConversationStates.ATTENDING;
    final String reply = "huch";
    final ChatAction action = new ChatAction() {
      public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
        assertEquals("boo", sentence.getTriggerExpression().getNormalized());
      }
View Full Code Here

  @Test
  public void testAddSingleStringValidCondition() {
    final SpeakerNPC bob = new SpeakerNPC("bob");

    final Engine en = new Engine(bob);
    ConversationStates state = IDLE;
    ConversationStates nextState = ATTENDING;

    final String triggers = "boo";

    final ChatCondition cc = new ChatCondition() {
      public boolean fire(final Player player, final Sentence sentence, final Entity npc) {
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.npc.ConversationStates

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.