Class Light
java.lang.Object
net.regsirius06.engine.core.walls.Light
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the absorption coefficient of this state.@NotNull ColorgetColor()Returns the color representation of this light source.static @NotNull ColorReturns a random color from the predefined list of light source colors.booleanisEmpty()Indicates whether this wall state represents an empty space.booleanIndicates whether this wall state can be dynamically generated.booleanisLight()Indicates whether this wall state emits light.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.regsirius06.engine.API.WallState
thisEquals
-
Field Details
-
COLORS
A list of predefined colors for light sources. These colors represent different possible light source colors.
-
-
Constructor Details
-
Light
public Light()Constructs a newLightinstance with a randomly chosen color.
-
-
Method Details
-
isLight
public boolean isLight()Indicates whether this wall state emits light. -
isEmpty
public boolean isEmpty()Indicates whether this wall state represents an empty space. -
isGenerable
public boolean isGenerable()Indicates whether this wall state can be dynamically generated.- Specified by:
isGenerablein interfaceWallState- Returns:
truesince 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:
getAbsorptionin interfaceWallState- Returns:
-10, representing a strong light-emitting property
-
getColor
Returns the color representation of this light source. -
getRandomColor
Returns a random color from the predefined list of light source colors.- Returns:
- a randomly chosen
Color
-