From 9f8c1d288f1e95b8b5580a218e051ad814e71bca Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 20:48:44 +0100 Subject: [PATCH] update --- src/main/java/BattleShip/BShip.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/BattleShip/BShip.java b/src/main/java/BattleShip/BShip.java index 38f98b5..190ede9 100644 --- a/src/main/java/BattleShip/BShip.java +++ b/src/main/java/BattleShip/BShip.java @@ -133,7 +133,16 @@ public class BShip { if(grid1.getEndGame() || grid2.getEndGame()) { grid1.setEndGame(); - + } else { + + if(grid2.areShipsPlaced()) { + shipsPlaced = true; + synchronized (lock) { + lock.notifyAll(); + } + } else { + textArea.setText(grid2.getText()); + } } } }