diff --git a/.idea/hellsgamers.iml b/.idea/hellsgamers.iml index 74774b6..6aac235 100644 --- a/.idea/hellsgamers.iml +++ b/.idea/hellsgamers.iml @@ -7,7 +7,7 @@ - + diff --git a/pom.xml b/pom.xml index 45a3e86..9b00264 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,12 @@ 3.0.0-M5 false + + test_* + + + diff --git a/src/test_/java/AIGridGUITest.java b/src/Test/java/test_AIGridGUI.java similarity index 97% rename from src/test_/java/AIGridGUITest.java rename to src/Test/java/test_AIGridGUI.java index 9325f89..533bef0 100644 --- a/src/test_/java/AIGridGUITest.java +++ b/src/Test/java/test_AIGridGUI.java @@ -4,7 +4,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; -public class AIGridGUITest { +public class test_AIGridGUI { AIGridGUI aiGridGUI = new AIGridGUI(10, 10); diff --git a/src/test_/java/BShipTest.java b/src/Test/java/test_BShip.java similarity index 94% rename from src/test_/java/BShipTest.java rename to src/Test/java/test_BShip.java index 9b5813a..462592c 100644 --- a/src/test_/java/BShipTest.java +++ b/src/Test/java/test_BShip.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertNotNull; -class BShipTest { +class test_BShip { @Test public void testStartGame() { BShip bShip = new BShip(); diff --git a/src/test_/java/CollisionCheckerTest.java b/src/Test/java/test_CollisionChecker.java similarity index 99% rename from src/test_/java/CollisionCheckerTest.java rename to src/Test/java/test_CollisionChecker.java index 767bda1..306449a 100644 --- a/src/test_/java/CollisionCheckerTest.java +++ b/src/Test/java/test_CollisionChecker.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; - class CollisionCheckerTest { + class test_CollisionChecker { CollisionChecker collisionChecker; @BeforeEach diff --git a/src/test_/java/ShipTest.java b/src/Test/java/test_Ship.java similarity index 96% rename from src/test_/java/ShipTest.java rename to src/Test/java/test_Ship.java index 83efd75..1ea4cdc 100644 --- a/src/test_/java/ShipTest.java +++ b/src/Test/java/test_Ship.java @@ -3,7 +3,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; -class ShipTest { +class test_Ship { @Test void counter() { diff --git a/src/test_/java/SnakeTest.java b/src/Test/java/test_Snake.java similarity index 99% rename from src/test_/java/SnakeTest.java rename to src/Test/java/test_Snake.java index 6c79afc..0128f5a 100644 --- a/src/test_/java/SnakeTest.java +++ b/src/Test/java/test_Snake.java @@ -7,7 +7,7 @@ import java.util.ArrayList; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -class SnakeTest { +class test_Snake { @Test public void testReset() { int gridSize = 20; diff --git a/src/main/java/PingPong/Paddle.java b/src/main/java/PingPong/Paddle.java index 34cad3f..2338524 100644 --- a/src/main/java/PingPong/Paddle.java +++ b/src/main/java/PingPong/Paddle.java @@ -22,11 +22,19 @@ public class Paddle extends Rectangle { } else if (id == 2) { y2 = y; } - this.width = width; - this.height = height; + PaddleWidth(width); + PaddleHeight(height); this.id = id; } + private void PaddleHeight(int height) { + this.height = height; + } + + private void PaddleWidth(int width) { + this.width = width; + } + public void released(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_W) { diff --git a/src/main/java/PingPong/Score.java b/src/main/java/PingPong/Score.java index 7068698..faa3d60 100644 --- a/src/main/java/PingPong/Score.java +++ b/src/main/java/PingPong/Score.java @@ -16,13 +16,25 @@ public class Score extends Rectangle { } public void draw(Graphics g) { - g.setColor(Color.white); - g.setFont(new Font("Consolas", Font.BOLD,50)); - g.drawLine(FRAME_WIDTH/2, 0, FRAME_WIDTH/2, FRAME_HEIGHT); - g.drawOval((FRAME_WIDTH/2)-(COURT_CIRCLE/2), (FRAME_HEIGHT/2) - (COURT_CIRCLE/2), COURT_CIRCLE,COURT_CIRCLE); - g.fillOval((FRAME_WIDTH/2)-(CENTER_DOT/2), (FRAME_HEIGHT/2) - (CENTER_DOT/2), CENTER_DOT,CENTER_DOT); + ScoreColor(g); + g.setFont(new Font("Consolas", Font.BOLD,50)); + drawScoreLine(g); + drawScoreOval(g); + g.fillOval((FRAME_WIDTH/2)-(CENTER_DOT/2), (FRAME_HEIGHT/2) - (CENTER_DOT/2), CENTER_DOT,CENTER_DOT); g.drawString(String.valueOf(player_1/10) + String.valueOf(player_1%10), (FRAME_WIDTH/2)- 75, 50); g.drawString(String.valueOf(player_2/10) + String.valueOf(player_2%10), (FRAME_WIDTH/2)+ 20, 50); } + + private void drawScoreOval(Graphics g) { + g.drawOval((FRAME_WIDTH/2)-(COURT_CIRCLE/2), (FRAME_HEIGHT/2) - (COURT_CIRCLE/2), COURT_CIRCLE,COURT_CIRCLE); + } + + private static void drawScoreLine(Graphics g) { + g.drawLine(FRAME_WIDTH/2, 0, FRAME_WIDTH/2, FRAME_HEIGHT); + } + + private static void ScoreColor(Graphics g) { + g.setColor(Color.white); + } } diff --git a/target/hellsgamers-1.0-SNAPSHOT.jar b/target/hellsgamers-1.0-SNAPSHOT.jar index 0adfec4..359ee6a 100644 Binary files a/target/hellsgamers-1.0-SNAPSHOT.jar and b/target/hellsgamers-1.0-SNAPSHOT.jar differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties index a3f66d2..aa0aa9b 100644 --- a/target/maven-archiver/pom.properties +++ b/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Wed Feb 08 21:32:53 CET 2023 +#Thu Feb 09 20:07:26 CET 2023 groupId=Hellsgamers artifactId=hellsgamers version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst index c11ae49..699554d 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -4,7 +4,6 @@ BattleShip\BSButton.class Snake\Window.class PingPong\GamePanel$AL.class Snake\Controller$1.class -MenuPanel$GameFrame.class BattleShip\Ship.class PingPong\Ball.class BattleShip\BShip$NewGameListener.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..4e2114b --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1,5 @@ +test_BShip.class +test_AIGridGUI.class +test_Snake.class +test_CollisionChecker.class +test_Ship.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..7cdc2e8 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1,5 @@ +C:\Users\Laura\IdeaProjects\hellsgamers\src\test\java\test_CollisionChecker.java +C:\Users\Laura\IdeaProjects\hellsgamers\src\test\java\test_Snake.java +C:\Users\Laura\IdeaProjects\hellsgamers\src\test\java\test_BShip.java +C:\Users\Laura\IdeaProjects\hellsgamers\src\test\java\test_Ship.java +C:\Users\Laura\IdeaProjects\hellsgamers\src\test\java\test_AIGridGUI.java diff --git a/target/surefire-reports/TEST-test_AIGridGUI.xml b/target/surefire-reports/TEST-test_AIGridGUI.xml new file mode 100644 index 0000000..7ee725b --- /dev/null +++ b/target/surefire-reports/TEST-test_AIGridGUI.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-test_BShip.xml b/target/surefire-reports/TEST-test_BShip.xml new file mode 100644 index 0000000..ce21295 --- /dev/null +++ b/target/surefire-reports/TEST-test_BShip.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-test_CollisionChecker.xml b/target/surefire-reports/TEST-test_CollisionChecker.xml new file mode 100644 index 0000000..bdd729a --- /dev/null +++ b/target/surefire-reports/TEST-test_CollisionChecker.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-test_Ship.xml b/target/surefire-reports/TEST-test_Ship.xml new file mode 100644 index 0000000..e9b29f9 --- /dev/null +++ b/target/surefire-reports/TEST-test_Ship.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-test_Snake.xml b/target/surefire-reports/TEST-test_Snake.xml new file mode 100644 index 0000000..37abb54 --- /dev/null +++ b/target/surefire-reports/TEST-test_Snake.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/test_AIGridGUI.txt b/target/surefire-reports/test_AIGridGUI.txt new file mode 100644 index 0000000..2cadde1 --- /dev/null +++ b/target/surefire-reports/test_AIGridGUI.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: test_AIGridGUI +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.84 s - in test_AIGridGUI diff --git a/target/surefire-reports/test_BShip.txt b/target/surefire-reports/test_BShip.txt new file mode 100644 index 0000000..eee48a9 --- /dev/null +++ b/target/surefire-reports/test_BShip.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: test_BShip +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.7 s - in test_BShip diff --git a/target/surefire-reports/test_CollisionChecker.txt b/target/surefire-reports/test_CollisionChecker.txt new file mode 100644 index 0000000..38af80f --- /dev/null +++ b/target/surefire-reports/test_CollisionChecker.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: test_CollisionChecker +------------------------------------------------------------------------------- +Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 s - in test_CollisionChecker diff --git a/target/surefire-reports/test_Ship.txt b/target/surefire-reports/test_Ship.txt new file mode 100644 index 0000000..25106b9 --- /dev/null +++ b/target/surefire-reports/test_Ship.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: test_Ship +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in test_Ship diff --git a/target/surefire-reports/test_Snake.txt b/target/surefire-reports/test_Snake.txt new file mode 100644 index 0000000..a76f835 --- /dev/null +++ b/target/surefire-reports/test_Snake.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: test_Snake +------------------------------------------------------------------------------- +Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s - in test_Snake diff --git a/target/test-classes/ShipTest.class b/target/test-classes/ShipTest.class deleted file mode 100644 index 2f24884..0000000 Binary files a/target/test-classes/ShipTest.class and /dev/null differ diff --git a/target/test-classes/AIGridGUITest.class b/target/test-classes/test_AIGridGUI.class similarity index 73% rename from target/test-classes/AIGridGUITest.class rename to target/test-classes/test_AIGridGUI.class index 50abe40..8d3c0f5 100644 Binary files a/target/test-classes/AIGridGUITest.class and b/target/test-classes/test_AIGridGUI.class differ diff --git a/target/test-classes/BShipTest.class b/target/test-classes/test_BShip.class similarity index 50% rename from target/test-classes/BShipTest.class rename to target/test-classes/test_BShip.class index 277a7c9..aedf091 100644 Binary files a/target/test-classes/BShipTest.class and b/target/test-classes/test_BShip.class differ diff --git a/target/test-classes/CollisionCheckerTest.class b/target/test-classes/test_CollisionChecker.class similarity index 60% rename from target/test-classes/CollisionCheckerTest.class rename to target/test-classes/test_CollisionChecker.class index 1b6f82b..3fcae45 100644 Binary files a/target/test-classes/CollisionCheckerTest.class and b/target/test-classes/test_CollisionChecker.class differ diff --git a/target/test-classes/test_Ship.class b/target/test-classes/test_Ship.class new file mode 100644 index 0000000..5631c9c Binary files /dev/null and b/target/test-classes/test_Ship.class differ diff --git a/target/test-classes/SnakeTest.class b/target/test-classes/test_Snake.class similarity index 79% rename from target/test-classes/SnakeTest.class rename to target/test-classes/test_Snake.class index 1c96711..5685e4e 100644 Binary files a/target/test-classes/SnakeTest.class and b/target/test-classes/test_Snake.class differ diff --git a/team.md b/team.md index 5690043..66ea298 100644 --- a/team.md +++ b/team.md @@ -1,4 +1,6 @@ - Berkan Sarp, fdai4616 - Justin Senn, fdai7107 - Eren Esen, fdai4581 -- Brice Tchoumi, fdai6138 \ No newline at end of file +- Brice Tchoumi, fdai6138 + +Bei Berkan, die mit der FD Nummer bewerten. \ No newline at end of file