From d74a50982cec58cd4f6ec0046af34dd0d1bcc6d5 Mon Sep 17 00:00:00 2001 From: fdai4581 Date: Wed, 8 Feb 2023 20:46:34 +0100 Subject: [PATCH] update --- src/main/java/BattleShip/BShip.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/BattleShip/BShip.java b/src/main/java/BattleShip/BShip.java index df2e30f..38f98b5 100644 --- a/src/main/java/BattleShip/BShip.java +++ b/src/main/java/BattleShip/BShip.java @@ -6,7 +6,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class BShip { - + Object lock = new Object(); public GridGUI grid1; JPanel thePanel = new JPanel(); JPanel textPanel = new JPanel(); @@ -126,5 +126,16 @@ public class BShip { startGame(); } } + public class IncomingGuessReader implements Runnable { + + public void run() { + while(grid1 != null && grid2 != null) { + + if(grid1.getEndGame() || grid2.getEndGame()) { + grid1.setEndGame(); + } + } + } + } }