Class Light

java.lang.Object
net.regsirius06.engine.core.walls.Light
All Implemented Interfaces:
Loadable, WallState

public final class Light extends Object implements WallState
Represents a light-emitting source in the labyrinth.

The Light class is an implementation of WallState that defines a space that emits light and has no physical barriers.

Light sources are visually represented with randomized colors chosen from a predefined set.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<Color>
    A list of predefined colors for light sources.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new Light instance with a randomly chosen color.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the absorption coefficient of this state.
    @NotNull Color
    Returns the color representation of this light source.
    static @NotNull Color
    Returns a random color from the predefined list of light source colors.
    boolean
    Indicates whether this wall state represents an empty space.
    boolean
    Indicates whether this wall state can be dynamically generated.
    boolean
    Indicates whether this wall state emits light.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.regsirius06.engine.API.WallState

    thisEquals
  • Field Details

    • COLORS

      public static final List<Color> COLORS
      A list of predefined colors for light sources. These colors represent different possible light source colors.
  • Constructor Details

    • Light

      public Light()
      Constructs a new Light instance with a randomly chosen color.
  • Method Details

    • isLight

      public boolean isLight()
      Indicates whether this wall state emits light.
      Specified by:
      isLight in interface WallState
      Returns:
      true since this class represents a light-emitting source
    • isEmpty

      public boolean isEmpty()
      Indicates whether this wall state represents an empty space.
      Specified by:
      isEmpty in interface WallState
      Returns:
      true since light sources do not obstruct movement
    • isGenerable

      public boolean isGenerable()
      Indicates whether this wall state can be dynamically generated.
      Specified by:
      isGenerable in interface WallState
      Returns:
      true since light sources can be placed procedurally
    • getAbsorption

      public double getAbsorption()
      Returns the absorption coefficient of this state.

      A negative absorption value indicates that the light source actively emits energy instead of absorbing it.

      Specified by:
      getAbsorption in interface WallState
      Returns:
      -10, representing a strong light-emitting property
    • getColor

      @NotNull public @NotNull Color getColor()
      Returns the color representation of this light source.
      Specified by:
      getColor in interface WallState
      Returns:
      a randomly selected color from COLORS
    • getRandomColor

      @NotNull public static @NotNull Color getRandomColor()
      Returns a random color from the predefined list of light source colors.
      Returns:
      a randomly chosen Color