From c88d85f5755cf1452c19f1a14e349a13fa378cb2 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 10 Dec 2021 11:00:05 +0100 Subject: [PATCH 1/6] changes in README.md --- README.md | 6 +++--- src/ch/zhaw/catan/SiedlerGame.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9871bab..cb41fb6 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ to be able to dominate your friends. #Rules 1. The min. Player amount is 2 and the max. Player amount is 4. -2. Each Player can build a road and a settlement free of cost at the beginning of -the game. +2. Each Player can build two roads and two settlements free of cost at the beginning of +the game. After the placement, each player gets resources from the field around the second settlement. 3. Every Player is being sorted into a faction. There cannot be two players in the same faction. 4. A player cannot build two settlements or cities right next one another. @@ -25,7 +25,7 @@ For a more detailed version of the rules please look here: https://www.catan.de/ #Usermanual First the program will ask how many players will be playing the game. The minimum amount of players is 2 and the maximum amount of players is 4. Each player will -be appointed to a faction. Now every player can build a settlement and a road +be appointed to a faction. In the next step, the program ask for the number of win points. The first player who reaches this number of win points, will win the game. Now every player can build a settlement and a road after every player has built a settlement and road, they can build a second settlement and road in reversed order. When the players build their second settlement they then receive the resources surrounding that specific settlement. diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 23057fa..7e14467 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -30,8 +30,8 @@ public class SiedlerGame { * * @param winPoints the number of points required to win the game * @param numberOfPlayers the number of players - * @throws IllegalArgumentException if winPoints is lower than - * three or players is not between two and four + * @throws IllegalArgumentException if winPoints is lower than 3 + * or players is not between two and four */ public SiedlerGame(int winPoints, int numberOfPlayers) { if (winPoints < 3 || numberOfPlayers < Config.MIN_NUMBER_OF_PLAYERS || numberOfPlayers > 4) { From 71344de9f4da38176b71e369d6de89a61855807b Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 10 Dec 2021 11:02:57 +0100 Subject: [PATCH 2/6] merge --- .idea/codeStyles/Project.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .idea/codeStyles/Project.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..fb9db83 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file From 7f3376c1a47e3f2973e8d1c387fd5868c0e92c6b Mon Sep 17 00:00:00 2001 From: Leonardo Brandenberger Date: Fri, 10 Dec 2021 11:11:19 +0100 Subject: [PATCH 3/6] Finished Player Class (Java Doc and Code Style) --- src/ch/zhaw/catan/Player.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ch/zhaw/catan/Player.java b/src/ch/zhaw/catan/Player.java index dc1f8a8..366270f 100644 --- a/src/ch/zhaw/catan/Player.java +++ b/src/ch/zhaw/catan/Player.java @@ -4,10 +4,10 @@ import java.util.HashMap; import java.util.List; /** - * This class is here in order to maintain the resources of the players, the amount of structures that they can build, - * control to see if a player has enough to build a new structure and to add them into a faction. + * This class is here in order to maintain the resources of the players, the amount of structures that they can build. + * And check if a player holds enough resources to build. * - * @author Leonardo Brandenberger, Roman Schrom, Andrin Fassbind, Stefan Amador + * @author Leonardo Brandenberger, Roman Schenk, Andrin Fassbind, Stefan Amador */ public class Player { @@ -18,7 +18,7 @@ public class Player { /** * The constructor initializes the faction and the Hashmaps resources and structureToUse. * - * @param faction this is the faction of the player. + * @param faction faction of the player. */ public Player(Config.Faction faction) { //Data fields @@ -36,7 +36,7 @@ public class Player { } /** - * This method returns all the resources the player has at the moment + * This method returns all the resources the player has at the moment. * * @return HashMap with the count of every resource */ @@ -45,7 +45,7 @@ public class Player { } /** - * This method returns player faction + * This method returns the player's faction. * * @return the faction of the player. */ @@ -56,15 +56,15 @@ public class Player { /** * This method returns the amount of a specific resource that a player owns. * - * @param resource the resource that is needed. - * @return the amount of the specific resource. + * @param resource the resource that is needed + * @return the amount of the specific resource */ public int getSpecificResource(Config.Resource resource) { return resources.get(resource); } /** - * This method adds a specific resource to resources + * This method adds a specific resource to resources of the player. * * @param resource to add * @param numberToAdd how much to add @@ -91,7 +91,7 @@ public class Player { /** * This method has to be used when a player wants to build a structure. It checks if a player has enough of the specific structure - * and resources to build one more. If the player is able to build, this method subtracts the building cost from the resources + * and resources to build . If the player is able to build, this method subtracts the building cost from the resources * in possession by the player. * It reduces the amount of the specific structure a player can build by 1. * From a05da8fb3457a8b21902d037db9fdc36caef4d4c Mon Sep 17 00:00:00 2001 From: Leonardo Brandenberger Date: Fri, 10 Dec 2021 11:13:12 +0100 Subject: [PATCH 4/6] Finished Road Class (Java Doc and Code Style) --- src/ch/zhaw/catan/Road.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ch/zhaw/catan/Road.java b/src/ch/zhaw/catan/Road.java index 730b149..a3e2ad9 100644 --- a/src/ch/zhaw/catan/Road.java +++ b/src/ch/zhaw/catan/Road.java @@ -2,11 +2,12 @@ package ch.zhaw.catan; import java.awt.Point; -/// TODO: 09/12/2021 Java Doc /** - * sub Class of Structure + * Sub Class of Structure * Can be saved in Siedler Board on Edges. + * + * @author Andrin Fassbind, Michael Ziegler */ public class Road extends Structure { @@ -14,11 +15,11 @@ public class Road extends Structure { private final Point start, end; /** - * Constructor of Road + * Constructs a road with a start and endpoint. * - * @param faction The faction of the owner - * @param start the coordinates of the start Point - * @param end the coordinates of the End Point + * @param faction The faction of the road owner + * @param start the coordinates of the start as a Point + * @param end the coordinates of the end as a Point */ public Road(Config.Faction faction, Point start, Point end) { super(faction); @@ -27,14 +28,18 @@ public class Road extends Structure { } /** - * @return the coordinates of the start Point + * Returns the Coordinate as a Point of the start of the road. + * + * @return Point of the start of the road */ public Point getStart() { return start; } /** - * @return the coordinates of the end Point + * Returns the Coordinate as a Point of the end of the road. + * + * @return Point of the end of the road */ public Point getEnd() { return end; From 5cf79daa8bc6f07adda3b04c23758416e2c11fc0 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Fri, 10 Dec 2021 11:13:55 +0100 Subject: [PATCH 5/6] 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 6/6] 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);