Class TextHasNumberCondition

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

@Dev(category=CHAT, label="\"\"?") public class TextHasNumberCondition extends Object implements ChatCondition
Does this trigger contain a number?
  • Constructor Details

    • TextHasNumberCondition

      public TextHasNumberCondition()
      Creates a new TextHasNumberCondition which checks for a positive integer.
    • TextHasNumberCondition

      public TextHasNumberCondition(int min)
      Creates a new TextHasNumberCondition which checks for a positive integer.
      Parameters:
      min - minimal accepted number
    • TextHasNumberCondition

      @Dev public TextHasNumberCondition(@Dev(defaultValue="0") int min, @Dev(defaultValue="2147483647") int max)
      Creates a new TextHasNumberCondition which checks if there is a number and if it is in range.
      Parameters:
      min - minimal accepted number
      max - maximal accepted number
  • 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