From 5cf79daa8bc6f07adda3b04c23758416e2c11fc0 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 10 Dec 2021 11:13:55 +0100 Subject: [PATCH 1/3] misc language lvl updated --- .idea/misc.xml | 2 +- src/ch/zhaw/catan/Road.java | 2 -- src/ch/zhaw/catan/Settlement.java | 4 ++++ src/ch/zhaw/catan/SiedlerBoard.java | 2 -- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index b573818..6bc01a8 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/ch/zhaw/catan/Road.java b/src/ch/zhaw/catan/Road.java index 730b149..ad13a93 100644 --- a/src/ch/zhaw/catan/Road.java +++ b/src/ch/zhaw/catan/Road.java @@ -2,8 +2,6 @@ package ch.zhaw.catan; import java.awt.Point; -/// TODO: 09/12/2021 Java Doc - /** * sub Class of Structure * Can be saved in Siedler Board on Edges. diff --git a/src/ch/zhaw/catan/Settlement.java b/src/ch/zhaw/catan/Settlement.java index d926308..4fc1da4 100644 --- a/src/ch/zhaw/catan/Settlement.java +++ b/src/ch/zhaw/catan/Settlement.java @@ -5,6 +5,8 @@ import java.awt.Point; /** * Sub Class of Structure and Super Class of City * Can be saved in Siedler Board on a corner + * + * @author Andrin Fassbind, Roman Schenk */ public class Settlement extends Structure { @@ -17,6 +19,8 @@ public class Settlement extends Structure { } /** + * This Methode Returns the Position of the Settlement + * * @return the datafield position */ public Point getPosition() { diff --git a/src/ch/zhaw/catan/SiedlerBoard.java b/src/ch/zhaw/catan/SiedlerBoard.java index cd7ceb0..ce3ea15 100644 --- a/src/ch/zhaw/catan/SiedlerBoard.java +++ b/src/ch/zhaw/catan/SiedlerBoard.java @@ -11,7 +11,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -//TODO Enhance JavaDoc /** * Subclass of HexBoard @@ -22,7 +21,6 @@ public class SiedlerBoard extends HexBoard fields = new HashMap<>(); From 0386d435293e3aef42e732a75c1166a06f185fdf Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 10 Dec 2021 11:18:06 +0100 Subject: [PATCH 2/3] updated javaodoc Siedler --- src/ch/zhaw/catan/Siedler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index 7211246..5df282c 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -5,6 +5,8 @@ import java.util.Random; /** * This Class manages the game process and contains the Main Method which creates and starts a new Parser and a new Game. + * + * @author Leonardo Brandeberger, Roman Schenk */ public class Siedler { /** @@ -29,7 +31,7 @@ public class Siedler { boolean diceThrown = false; while (running) { Config.Faction currentPlayerFaction = game.getCurrentPlayerFaction(); - parser.displayGameboard(game.getBoard().getTextView()); //TODO Every turn or separate command? + parser.displayGameboard(game.getBoard().getTextView()); parser.playerTurn(currentPlayerFaction); if (!diceThrown) { throwDice(parser, game); From 20d73bd5e0876a24031b4ab6cbb511f04e18df56 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 10 Dec 2021 11:20:56 +0100 Subject: [PATCH 3/3] updated javaodoc SiedlerBoard --- src/ch/zhaw/catan/SiedlerBoard.java | 23 +++++++++++++---------- test/ch/zhaw/catan/SiedlerBoardTest.java | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/ch/zhaw/catan/SiedlerBoard.java b/src/ch/zhaw/catan/SiedlerBoard.java index ce3ea15..adf84fb 100644 --- a/src/ch/zhaw/catan/SiedlerBoard.java +++ b/src/ch/zhaw/catan/SiedlerBoard.java @@ -25,7 +25,7 @@ public class SiedlerBoard extends HexBoard fields = new HashMap<>(); private Config.Faction longestRoadFaction = null; - private int longestRoadLenth = 0; + private int longestRoadLength = 0; /** * Method to create the predefined game field from Config. @@ -47,6 +47,15 @@ public class SiedlerBoard extends HexBoard longestRoadLenth && players.get(factionA) > 4) { + if (players.get(factionA) > longestRoadLength && players.get(factionA) > 4) { longestRoadFaction = factionA; - longestRoadLenth = players.get(factionA); + longestRoadLength = players.get(factionA); } } return longestRoadFaction; } - //todo javadoc - public int getLongestRoadLenth() { - return longestRoadLenth; - } - /** * This method is recursive and adds all roads which belongs to a specific players and stringing together to a HashSet. * The length of the HashSet represents the length of the longest Road the player has. diff --git a/test/ch/zhaw/catan/SiedlerBoardTest.java b/test/ch/zhaw/catan/SiedlerBoardTest.java index f083917..8452824 100644 --- a/test/ch/zhaw/catan/SiedlerBoardTest.java +++ b/test/ch/zhaw/catan/SiedlerBoardTest.java @@ -41,7 +41,7 @@ public class SiedlerBoardTest { System.out.println(board.getTextView()); assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList)); - assertEquals(6, board.getLongestRoadLenth()); + assertEquals(6, board.getLongestRoadLength()); } @Test @@ -50,7 +50,7 @@ public class SiedlerBoardTest { System.out.println(board.getTextView()); assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList)); - assertEquals(5, board.getLongestRoadLenth()); + assertEquals(5, board.getLongestRoadLength()); } }