Enum Class SchedulerState

java.lang.Object
java.lang.Enum<SchedulerState>
fr.robie.machineengine.api.machine.SchedulerState
All Implemented Interfaces:
Serializable, Comparable<SchedulerState>, Constable

public enum SchedulerState extends Enum<SchedulerState>
Scheduling state of a machine (ARCHITECTURE.md ยง17.1). Only ACTIVE machines tick; the others wait for one of their wake reasons.
  • Enum Constant Details

    • ACTIVE

      public static final SchedulerState ACTIVE
      Ticks every game tick.
    • SCHEDULED

      public static final SchedulerState SCHEDULED
      Sleeps until a known game tick.
    • WAITING

      public static final SchedulerState WAITING
      Needs input; wakes when its storages receive something.
    • BLOCKED

      public static final SchedulerState BLOCKED
      Output full or a dependency missing; wakes when something leaves its storages.
    • SLEEPING

      public static final SchedulerState SLEEPING
      Nothing to do until any signal.
    • DISABLED

      public static final SchedulerState DISABLED
      Never ticks (placeholder, or disabled by configuration or errors).
  • Method Details

    • values

      public static SchedulerState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SchedulerState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • wakesOn

      public boolean wakesOn(WakeReason reason)
      Returns:
      whether reason makes a machine in this state active again