Class DaylightCondition

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

@Dev(category=ENVIRONMENT, label="Time?") public class DaylightCondition extends Object implements ChatCondition
Checks the current day light phase.
Author:
hendrik
  • Constructor Details

    • DaylightCondition

      public DaylightCondition(DaylightPhase... daylightPhases)
      creates a new DaytimeCondition
      Parameters:
      daylightPhases - one or more daylight phases
  • Method Details

    • fire

      public boolean fire(Player player, Sentence sentence, Entity npc)
      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
      npc - the NPC doing the transition
      Returns:
      true, if the transition is possible, false otherwise
    • hashCode

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

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