Class GreetingMatchesNameCondition

java.lang.Object
games.stendhal.server.entity.npc.condition.GreetingMatchesNameCondition
All Implemented Interfaces:
ChatCondition, PreTransitionCondition

@Dev(category=CHAT, label="\"\"?") public class GreetingMatchesNameCondition extends Object implements ChatCondition
Checks if an optional subject in the user input matches the NPC name. Use with greeting messages in IDLE state at busy places.
  • Constructor Details

    • GreetingMatchesNameCondition

      public GreetingMatchesNameCondition(String name)
      Creates a new GreetingMatchesNameCondition.
      Parameters:
      name - name to match against
  • Method Details

    • fire

      public boolean fire(Player player, Sentence sentence, Entity entity)
      Description copied from interface: PreTransitionCondition
      can the transition be done?
      Specified by:
      fire in interface ChatCondition
      Specified by:
      fire in interface PreTransitionCondition
      Parameters:
      player - player who caused the transition
      sentence - text he/she said
      entity - the NPC doing the transition
      Returns:
      true, if the transition is possible, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object