Browse Source

Fixed GameLogicTest with new test parameter in start() function

fleetstorm
Lorenz Hohmann 3 years ago
parent
commit
805c233108
  1. 7
      src/main/java/de/tims/fleetstorm/gui/GameLogic.java
  2. 2
      src/test/java/de/tims/fleetstorm/gui/LogicTest.java

7
src/main/java/de/tims/fleetstorm/gui/GameLogic.java

@ -173,10 +173,10 @@ public class GameLogic extends JPanel {
frame.setResizable(true); frame.setResizable(true);
frame.setVisible(true); frame.setVisible(true);
gui.start();
gui.start(false);
} }
public void start() {
public void start(boolean test) {
this.gameState = GameLogic.PREPARATION; this.gameState = GameLogic.PREPARATION;
this.playerMove = true; this.playerMove = true;
@ -202,7 +202,8 @@ public class GameLogic extends JPanel {
// enter game loop // enter game loop
this.gameState = GameLogic.RUNNING; this.gameState = GameLogic.RUNNING;
this.nextMove(true);
if (!test)
this.nextMove(true);
} }
public void nextMove(boolean playerMove) { public void nextMove(boolean playerMove) {

2
src/test/java/de/tims/fleetstorm/gui/LogicTest.java

@ -11,7 +11,7 @@ class LogicTest {
@BeforeEach @BeforeEach
void setup() { void setup() {
guiLogic.start();
guiLogic.start(true);
} }
@Test @Test

Loading…
Cancel
Save