Browse Source

Flagged cells will not be flooded

feature_Minesweeper_Playfield
kfkama 3 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() { public void flood() {
if (type == CellType.Bomb) {
if (type == CellType.Bomb || flagged) {
return; return;
} }

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

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

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

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