ResetMethode verändert
parent
24100d209b
commit
a4c98bc5d9
|
@ -9,8 +9,10 @@ import java.util.List;
|
|||
public class HitoriBoard {
|
||||
private final HitoriCell[][] board;
|
||||
private final List<String> solutionCoordinates;
|
||||
private int[][] originalBoardData;
|
||||
|
||||
public HitoriBoard(int[][] numbers, List<String> solutionCoordinates) {
|
||||
this.originalBoardData = numbers; // Oginaldaten speichern
|
||||
this.board = new HitoriCell[numbers.length][numbers[0].length];
|
||||
this.solutionCoordinates = solutionCoordinates;
|
||||
initializeBoard(numbers);
|
||||
|
@ -19,7 +21,7 @@ public class HitoriBoard {
|
|||
public List<String> getSolutionCoordinates() {
|
||||
return solutionCoordinates;
|
||||
}
|
||||
|
||||
|
||||
public HitoriCell[][] getBoard() {
|
||||
return board;
|
||||
}
|
||||
|
@ -37,18 +39,19 @@ public class HitoriBoard {
|
|||
return board[row][col];
|
||||
}
|
||||
|
||||
public int getSize(){
|
||||
public int getSize() {
|
||||
return board.length;
|
||||
}
|
||||
|
||||
//Board zurücksetzen zu dem Anfangszustand
|
||||
public void resetBoard(){
|
||||
public void resetBoard() {
|
||||
//initializeBoard(originalBoardData);
|
||||
for (int i = 0; i < board.length; i++) {
|
||||
for (int j = 0; j < board[i].length; j++) {
|
||||
board[i][j].setState(HitoriCell.CellState.GRAY);
|
||||
board[i][j].setState(HitoriCell.CellState.GRAY); // Zurücksetzen
|
||||
System.out.println("Zelle Test (" + i + "," + j + ") zurückgesetzt auf GRAY");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue