From dd5ac1e70856d41bca258827c7d86c6f4428cf44 Mon Sep 17 00:00:00 2001 From: Thoumi Ngonga Brice Date: Mon, 6 Feb 2023 21:30:40 +0100 Subject: [PATCH] Update Implementation Methode AIGridGUI --- src/main/java/BattleShip/AIGridGUI.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/BattleShip/AIGridGUI.java b/src/main/java/BattleShip/AIGridGUI.java index 0bfc9f9..fc1e823 100644 --- a/src/main/java/BattleShip/AIGridGUI.java +++ b/src/main/java/BattleShip/AIGridGUI.java @@ -138,9 +138,15 @@ public class AIGridGUI extends JPanel { testLocations = null; } - // - + //Mark all cells containing a ship and disable all cells in the grid. + for (BSButton bsb : buttons) { + if(bsb.getCellContents() != null) { + bsb.setBackground(Color.blue); + bsb.setBorder(loweredBevel); + } + bsb.setEnabled(false); + } text = "Ready to start the game."; shipsPlaced = true;