From 246b0991b0c8e0881c90f5f6a9ec8ffb06119db2 Mon Sep 17 00:00:00 2001 From: Thoumi Ngonga Brice Date: Wed, 8 Feb 2023 15:25:36 +0100 Subject: [PATCH] Add Methode void StartGame and BuildGui to class Bship --- src/main/java/BattleShip/AIGridGUI.java | 1 + src/main/java/BattleShip/BShip.java | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/main/java/BattleShip/AIGridGUI.java b/src/main/java/BattleShip/AIGridGUI.java index 7e1f63e..1cf8be4 100644 --- a/src/main/java/BattleShip/AIGridGUI.java +++ b/src/main/java/BattleShip/AIGridGUI.java @@ -8,6 +8,7 @@ import java.awt.event.MouseListener; import java.util.ArrayList; import java.util.*; + public class AIGridGUI extends JPanel { ArrayList buttons = new ArrayList(); ArrayList allShips = new ArrayList(); diff --git a/src/main/java/BattleShip/BShip.java b/src/main/java/BattleShip/BShip.java index 386888c..13029cd 100644 --- a/src/main/java/BattleShip/BShip.java +++ b/src/main/java/BattleShip/BShip.java @@ -1,4 +1,24 @@ package BattleShip; public class BShip { + + public GridGUI grid1; + public AIGridGUI grid2; + int rows = 10; + int columns = 10; + + public void startGame() { + + //Create grids and rest of GUI. + + grid1 = new GridGUI(rows, columns); + grid1.build(); + + grid2 = new AIGridGUI(rows, columns); + + buildGUI(); + } + + public void buildGUI() {} + }