diff --git a/README.md b/README.md index 9871bab..7ca0144 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ number that the player rolled with the dice. Now as for the commands a player has to put in while it's their turn: #Build Settlement +``build settlement`` Builds a settlement + When it's the players turn, they can build a new settlement by giving the command build settlement. With that they will be asked where they want to build said settlement and to enter the coordinates, then the program will check if those coordinates are available or not. Then the @@ -43,6 +45,8 @@ insufficient resources the settlement will not be built and an error message wil appear. The turn of the current player will continue until the player ends it. #Build City +``build city`` Builds a city + During the players turn they can build a city on the same coordinates that they have already built a settlement on. To do that they have to enter the command build city. Then they have to add the coordinates that they want the city to be @@ -53,6 +57,8 @@ the program will subtract them of the players resources, otherwise the city won' be build and the player continues their turn until they end it. #Build Road +``build road`` Builds a road + During the current players turn, the player can build a new road by giving the command build road. Then the player will be asked to give the coordinates for where they want to build the new road after entering the coordinates the program will @@ -64,6 +70,8 @@ have enough resources the road will not be built and the player will receive an error message. The player continues their turn until they end it. #Trade with Bank +``trade with bank`` Let's the player trade resources with the bank + The current player can trade resources with the bank by entering the command trade with bank. The player then can enter what and how many resources they want then they have to enter what resources they will give in return. The trade course @@ -72,14 +80,21 @@ trade for one of their choosing from the bank. If they do not have enough resour to give the trade will not be completed and the player may continue their turn. #Next Player +``next player`` Ends a players turn + When the current player has done all the building and trading they wanted and now want to end their turn they can end it by entering the command next player. By entering this command the player relinquishes their turn and the next player may start their turn. #Quit +``quit`` Let's a player quit the game + If a player wants to quit the game they can enter the command quit while it's their turn to quit the game. +#Coordinates + + #Class Diagram diff --git a/src/ch/zhaw/catan/SiedlerBoard.java b/src/ch/zhaw/catan/SiedlerBoard.java index 6a4cbb7..bcfab3b 100644 --- a/src/ch/zhaw/catan/SiedlerBoard.java +++ b/src/ch/zhaw/catan/SiedlerBoard.java @@ -27,7 +27,7 @@ public class SiedlerBoard extends HexBoard fields = new HashMap<>(); Config.Faction longestRoadFaction = null; - int longestRoadLenth = 0; + int longestRoadLength = 0; /** * Method to create the predefined game field from Config. @@ -172,13 +172,13 @@ public class SiedlerBoard extends HexBoard= 5 && players.get(faction) > longestRoadLenth) { + if (players.get(faction) >= 5 && players.get(faction) > longestRoadLength) { longestRoadFaction = faction; - longestRoadLenth = players.get(faction); + longestRoadLength = players.get(faction); } } } @@ -186,8 +186,8 @@ public class SiedlerBoard extends HexBoard