Package visualizationElements
Klasse Cell
java.lang.Object
visualizationElements.Cell
Represents a Cell of a maze.
-
Feldübersicht
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint
Returns the column number.int
getRow()
Returns the row number.boolean
Returns whether the cell has a east wall or not.boolean
Returns whether the cell has a north wall or not.boolean
Returns whether the cell has a south wall or not.boolean
Returns whether the cell has a west wall or not.boolean
isGoal()
Returns whether the cell is the goal of the maze it contains to.boolean
isStart()
Returns whether the cell is the start of the maze it contains to.boolean
Returns whether the cell was visited or not.void
Sets the cell as visited.void
Sets the cell's east wall to false.void
Sets the cell's north wall to false.void
Sets the cell's south wall to false.void
Sets the cell's west wall to false.void
Sets the cell as the goal of the maze.void
Sets the cell as the start cell of the maze it contains to.void
setEastWall
(boolean eastWall) void
setNorthWall
(boolean northWall) void
setSouthWall
(boolean southWall) void
setWestWall
(boolean westWall)
-
Felddetails
-
northWall
private boolean northWall -
southWall
private boolean southWall -
westWall
private boolean westWall -
eastWall
private boolean eastWall -
isStart
private boolean isStart -
isGoal
private boolean isGoal -
visited
private boolean visited -
column
private final int column -
row
private final int row
-
-
Konstruktordetails
-
Cell
public Cell(int column, int row) Creates a new cell of a maze.- Parameter:
column
- Number of the column the cell is arranged in.row
- Number of the row the cell is arranged in.
-
-
Methodendetails
-
removeNorthWall
public void removeNorthWall()Sets the cell's north wall to false. -
removeSouthWall
public void removeSouthWall()Sets the cell's south wall to false. -
removeWestWall
public void removeWestWall()Sets the cell's west wall to false. -
removeEastWall
public void removeEastWall()Sets the cell's east wall to false. -
setNorthWall
public void setNorthWall(boolean northWall) - Parameter:
northWall
- the northWall to set
-
hasNorthWall
public boolean hasNorthWall()Returns whether the cell has a north wall or not.- Gibt zurück:
- True if the cell has a north wall, false otherwise.
-
setSouthWall
public void setSouthWall(boolean southWall) - Parameter:
southWall
- the southWall to set
-
hasSouthWall
public boolean hasSouthWall()Returns whether the cell has a south wall or not.- Gibt zurück:
- True if the cell has a south wall, false otherwise.
-
setWestWall
public void setWestWall(boolean westWall) - Parameter:
westWall
- the westWall to set
-
hasWestWall
public boolean hasWestWall()Returns whether the cell has a west wall or not.- Gibt zurück:
- True if the cell has a west wall, false otherwise.
-
setEastWall
public void setEastWall(boolean eastWall) - Parameter:
eastWall
- the eastWall to set
-
hasEastWall
public boolean hasEastWall()Returns whether the cell has a east wall or not.- Gibt zurück:
- True if the cell has a east wall, false otherwise.
-
markAsVisited
public void markAsVisited()Sets the cell as visited. -
isVisited
public boolean isVisited()Returns whether the cell was visited or not.- Gibt zurück:
- True if the cell was visited, false otherwise.
-
setAsGoal
public void setAsGoal()Sets the cell as the goal of the maze. -
isGoal
public boolean isGoal()Returns whether the cell is the goal of the maze it contains to.- Gibt zurück:
- True if the cell is the goal of the maze, false otherwise.
-
getRow
public int getRow()Returns the row number.- Gibt zurück:
- the number of the row the cell is arranged to.
-
getColumn
public int getColumn()Returns the column number.- Gibt zurück:
- the number of the column the cell is arranged to.
-
setAsStart
public void setAsStart()Sets the cell as the start cell of the maze it contains to. -
isStart
public boolean isStart()Returns whether the cell is the start of the maze it contains to.- Gibt zurück:
- True if the cell is the start cell of the maze, false otherwise.
-