Class MainController.Light

java.lang.Object
org.tquadrat.shootingtimer.MainController.Light
Enclosing class:
MainController

@ClassVersion(sourceVersion="$Id: MainController.java 106 2022-01-19 15:53:24Z tquadrat $") @API(status=INTERNAL, since="0.1.0") private static class MainController.Light extends Object
This class will manage the status for the lights.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: MainController.java 106 2022-01-19 15:53:24Z tquadrat $
Since:
0.1.0
UML Diagram
UML Diagram for "org.tquadrat.shootingtimer.MainController.Light"

UML Diagram for "org.tquadrat.shootingtimer.MainController.Light"

UML Diagram for "org.tquadrat.shootingtimer.MainController.Light"
  • Field Details

    • m_OffColor

      private final Color m_OffColor
      The color for the OFF state.
    • m_ColorChanger

      private final Consumer<Color> m_ColorChanger
      The method that is used to set the colour for the light.
    • m_OnColor

      private final Color m_OnColor
      The color for the ON state.
    • m_Status

      private boolean m_Status
      The current status; true mean ON, false is OFF.
  • Constructor Details

    • Light

      public Light(Color onColor, Consumer<Color> colorChanger)
      Creates a new Light instance.
      Parameters:
      onColor - The colour for the ON state.
      colorChanger - The method that is used to set the colour for the light.
  • Method Details

    • off

      public final void off()
      Switches the light off.
    • on

      public final void on()
      Switches the light off.
    • toggle

      public final void toggle()
      Toggles the light.