From 805c233108b2c56332bc7a7e9b7dbb5efd8b0be4 Mon Sep 17 00:00:00 2001 From: Lorenz Hohmann Date: Mon, 17 Jan 2022 14:37:39 +0100 Subject: [PATCH] Fixed GameLogicTest with new test parameter in start() function --- src/main/java/de/tims/fleetstorm/gui/GameLogic.java | 7 ++++--- src/test/java/de/tims/fleetstorm/gui/LogicTest.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/tims/fleetstorm/gui/GameLogic.java b/src/main/java/de/tims/fleetstorm/gui/GameLogic.java index 557ce00..865e59c 100644 --- a/src/main/java/de/tims/fleetstorm/gui/GameLogic.java +++ b/src/main/java/de/tims/fleetstorm/gui/GameLogic.java @@ -173,10 +173,10 @@ public class GameLogic extends JPanel { frame.setResizable(true); frame.setVisible(true); - gui.start(); + gui.start(false); } - public void start() { + public void start(boolean test) { this.gameState = GameLogic.PREPARATION; this.playerMove = true; @@ -202,7 +202,8 @@ public class GameLogic extends JPanel { // enter game loop this.gameState = GameLogic.RUNNING; - this.nextMove(true); + if (!test) + this.nextMove(true); } public void nextMove(boolean playerMove) { diff --git a/src/test/java/de/tims/fleetstorm/gui/LogicTest.java b/src/test/java/de/tims/fleetstorm/gui/LogicTest.java index 07e2aea..2b1e357 100644 --- a/src/test/java/de/tims/fleetstorm/gui/LogicTest.java +++ b/src/test/java/de/tims/fleetstorm/gui/LogicTest.java @@ -11,7 +11,7 @@ class LogicTest { @BeforeEach void setup() { - guiLogic.start(); + guiLogic.start(true); } @Test