|
@ -62,16 +62,20 @@ public class Cell extends JButton { |
|
|
if (isEnabled()) { |
|
|
if (isEnabled()) { |
|
|
if (flagged) { |
|
|
if (flagged) { |
|
|
flagged = false; |
|
|
flagged = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (type == CellType.Number) { |
|
|
if (type == CellType.Number) { |
|
|
setBackground(Color.gray); |
|
|
setBackground(Color.gray); |
|
|
|
|
|
playfield.cellDried(); |
|
|
} else { |
|
|
} else { |
|
|
setBackground(Color.red); |
|
|
setBackground(Color.red); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
flagged = true; |
|
|
flagged = true; |
|
|
setBackground(Color.cyan); |
|
|
setBackground(Color.cyan); |
|
|
|
|
|
if (type == CellType.Number) { |
|
|
|
|
|
playfield.cellFlooded(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|