From 2980e75fb8bcc0d080058bd06da3981396736867 Mon Sep 17 00:00:00 2001 From: Jonas Wagner Date: Tue, 25 Jan 2022 08:38:44 +0100 Subject: [PATCH 1/3] Refactor not used imports --- src/main/java/Gameboard.java | 1 - src/main/java/Player.java | 2 -- src/test/java/GameTest.java | 6 ------ src/test/java/PlayerTest.java | 4 ---- 4 files changed, 13 deletions(-) diff --git a/src/main/java/Gameboard.java b/src/main/java/Gameboard.java index 03d5fdb..5bb535b 100644 --- a/src/main/java/Gameboard.java +++ b/src/main/java/Gameboard.java @@ -1,4 +1,3 @@ -import java.lang.reflect.Array; import java.util.Arrays; public class Gameboard { diff --git a/src/main/java/Player.java b/src/main/java/Player.java index 5e5d9a9..8a4f438 100644 --- a/src/main/java/Player.java +++ b/src/main/java/Player.java @@ -1,5 +1,3 @@ -import javax.sound.midi.Soundbank; -import java.util.Arrays; public class Player { diff --git a/src/test/java/GameTest.java b/src/test/java/GameTest.java index 122fbe6..994f82b 100644 --- a/src/test/java/GameTest.java +++ b/src/test/java/GameTest.java @@ -1,10 +1,4 @@ -import static org.assertj.core.api.Assertions.*; - import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; public class GameTest { diff --git a/src/test/java/PlayerTest.java b/src/test/java/PlayerTest.java index 5000e0b..337ddab 100644 --- a/src/test/java/PlayerTest.java +++ b/src/test/java/PlayerTest.java @@ -1,11 +1,7 @@ import static org.assertj.core.api.Assertions.*; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; public class PlayerTest { From 6890c80034c9310358a0421db63d832a79fffab5 Mon Sep 17 00:00:00 2001 From: Jonas Wagner Date: Tue, 25 Jan 2022 08:40:14 +0100 Subject: [PATCH 2/3] Add get and set methods to Figure.java --- src/main/java/Figure.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/Figure.java b/src/main/java/Figure.java index 8cf72b9..9b7ffa9 100644 --- a/src/main/java/Figure.java +++ b/src/main/java/Figure.java @@ -6,4 +6,11 @@ public class Figure { this.position = -1; } + public void setPosition(int position) { + this.position = position; + } + + public int getPosition() { + return position; + } } From 0b4d0cdee04bd808fce553bb8b1b12fcd368149d Mon Sep 17 00:00:00 2001 From: Jonas Wagner Date: Tue, 25 Jan 2022 08:42:43 +0100 Subject: [PATCH 3/3] Refactor startGame Method --- src/main/java/Game.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/Game.java b/src/main/java/Game.java index da68c76..0252238 100644 --- a/src/main/java/Game.java +++ b/src/main/java/Game.java @@ -8,10 +8,9 @@ public class Game { public static void main(String[] args) { Game g = new Game(); - g.startGame(); } - public void startGame() { + public Game() { this.gb = new Gameboard(); gb.initGameboard(); p1 = new Player("Rot");