Class TimeReachedCondition

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

@Dev(category=TIME, label="Time?") public class TimeReachedCondition extends Object implements ChatCondition
Check if current system time reached a timestamp stored in a quest slot. If the quest slot isn't in the expected format, returns true
Author:
omero
See Also:
SayTimeRemainingUntilTimeReachedAction, SetQuestToFutureRandomTimeStampAction
  • Constructor Details

    • TimeReachedCondition

      public TimeReachedCondition(String questname)
      Creates a new TimeReachedCondition for checking wether or not a timestamp in quest slot has been reached
      Parameters:
      questname - name of the quest slot to check
    • TimeReachedCondition

      @Dev public TimeReachedCondition(String questname, int index)
      Creates a new TimeReachedCondition for checking wether or not a timestamp in quest slot has been reached
      Parameters:
      questname - name of quest slot to check
      index - index of sub state
  • 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