Browse Source

Flagged cells will not be flooded

feature_Minesweeper_Playfield
kfkama 2 years ago
parent
commit
7de023fa3e
  1. 2
      src/main/java/Minesweeper/Cell.java
  2. 5
      src/main/java/Minesweeper/MinesweeperGame.java
  3. 2
      src/main/java/Minesweeper/Playfield.java

2
src/main/java/Minesweeper/Cell.java

@ -85,7 +85,7 @@ public class Cell extends JButton {
}
public void flood() {
if (type == CellType.Bomb) {
if (type == CellType.Bomb || flagged) {
return;
}

5
src/main/java/Minesweeper/MinesweeperGame.java

@ -25,7 +25,4 @@ public class MinesweeperGame extends JPanel {
f.setLayout(null);
f.setVisible(true);
}
}
}

2
src/main/java/Minesweeper/Playfield.java

@ -134,4 +134,4 @@ public class Playfield {
System.exit(0);
}
}
}
}
Loading…
Cancel
Save