Fix adjacency count being incorrect due to underlying grid structure in GridWrapper

This commit is contained in:
2024-05-27 14:01:16 +01:00
parent 07ab0b898f
commit c72efa8b44
2 changed files with 39 additions and 10 deletions
@@ -28,6 +28,13 @@ public class GridWrapper {
}
}
public void switchBomb(int destinationColumn, int destinationRow) {
if (isValid(currentColumn, currentRow) && isValid(destinationColumn, destinationRow)) {
grid[destinationColumn][destinationRow] = true;
grid[currentColumn][currentRow] = false;
}
}
public boolean isBomb() {
return isValid(currentColumn, currentRow) && grid[currentColumn][currentRow];
}