Package net.regsirius06.engine.point
Class Wall
java.lang.Object
net.regsirius06.engine.point.Point
net.regsirius06.engine.point.ColoredPoint
net.regsirius06.engine.point.Wall
The
Wall class extends the ColoredPoint class and adds a WallState attribute
to represent the state of a wall (such as whether it's passable, blocked, or any other custom state).
This class is particularly useful for representing walls in a maze or grid-based environment,
where each wall can have a position, color, and state.
The state of the wall is represented by the WallState enum, which provides different states
that can be associated with a wall (e.g., passable, blocked, etc.).
This class is most commonly used to represent a maze cell's wall in a maze generation or maze-solving algorithm.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newWallwith the specifiedxandycoordinates, and a givenWallStateto represent the wall's current state.Constructs a newWallby copying the coordinates of an existingPointand setting theWallStateto the specified state. -
Method Summary
Methods inherited from class net.regsirius06.engine.point.ColoredPoint
getColor, getColoredPointMethods inherited from class net.regsirius06.engine.point.Point
angleTo, angleTo, distanceTo, distanceTo, equals, getPoint, getX, getY, hashCode, isPointInside, isPointInside, movePoint, movePoint
-
Constructor Details
-
Wall
Constructs a newWallwith the specifiedxandycoordinates, and a givenWallStateto represent the wall's current state. The color of the wall is determined by theWallState.- Parameters:
x- thexcoordinate of the wally- theycoordinate of the wallstate- theWallStaterepresenting the state of the wall
-
Wall
Constructs a newWallby copying the coordinates of an existingPointand setting theWallStateto the specified state. The color of the wall is determined by the state.- Parameters:
point- thePointto copy coordinates fromstate- theWallStaterepresenting the state of the wall
-
-
Method Details
-
getState
Returns theWallStateof this wall.- Returns:
- the
WallStaterepresenting the current state of the wall
-