Class Event

All Implemented Interfaces:
Serializable, DeepCopyable<Attribute>
Direct Known Subclasses:
FunctionalEvent

public abstract class Event extends Attribute
Represents a boolean-triggered event that is evaluated each tick.

Events can encapsulate internal logic or external stimuli, and can be named explicitly or assigned a unique name automatically. Each event increases the global event count.

See Also:
  • Constructor Details

    • Event

      public Event(String name, boolean isRecorded)
      Constructs an event with a specific name and recording flag.
      Parameters:
      name - the event name
      isRecorded - whether the event is recorded in output
    • Event

      public Event(boolean isRecorded)
      Constructs an event with a generated name and a recording flag.
      Parameters:
      isRecorded - whether the event is recorded
    • Event

      public Event(String name)
      Constructs an event with a specified name, defaulting to recording enabled.
      Parameters:
      name - the event name
    • Event

      public Event()
      Constructs an event with a generated name and recording enabled by default.
  • Method Details

    • isTriggered

      public abstract boolean isTriggered()
      Indicates whether the event has been triggered during this tick.
      Returns:
      true if triggered
    • run

      public abstract void run()
      Runs this event's internal logic.
      Specified by:
      run in class Attribute
    • deepCopy

      public Event deepCopy()