Browse Source

Refactor startGame Method

AIPlayer
Jonas Wagner 3 years ago
parent
commit
2e08539e68
  1. 17
      src/main/java/Game.java
  2. 16
      src/test/java/GameTest.java

17
src/main/java/Game.java

@ -1,7 +1,22 @@
public class Game { public class Game {
Gameboard gb;
Player p1;
Player p2;
Player p3;
Player p4;
public static void main(String[] args) { public static void main(String[] args) {
Gameboard gb = new Gameboard();
Game g = new Game();
g.startGame();
}
public void startGame() {
this.gb = new Gameboard();
gb.initGameboard(); gb.initGameboard();
p1 = new Player("Rot");
p2 = new Player("Blau");
p3 = new Player("Gelb");
p4 = new Player("Grün");
} }
} }

16
src/test/java/GameTest.java

@ -8,4 +8,20 @@ import org.junit.jupiter.params.provider.MethodSource;
public class GameTest { public class GameTest {
private Gameboard gb;
private Player p1;
private Player p2;
private Player p3;
private Player p4;
@BeforeEach
void setup() {
this.gb = new Gameboard();
gb.initGameboard();
p1 = new Player("Rot");
p2 = new Player("Blau");
p3 = new Player("Gelb");
p4 = new Player("Grün");
}
} }
Loading…
Cancel
Save