the readme of Siedler of catan has been written and language correction.

This commit is contained in:
Speedy Gonzalez 2021-12-10 10:36:48 +01:00
parent 3f625e1e47
commit c5a8330d0f
3 changed files with 22 additions and 7 deletions

View File

@ -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: Now as for the commands a player has to put in while it's their turn:
#Build Settlement #Build Settlement
``build settlement`` Builds a settlement
When it's the players turn, they can build a new settlement by giving the command 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 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 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. appear. The turn of the current player will continue until the player ends it.
#Build City #Build City
``build city`` Builds a city
During the players turn they can build a city on the same coordinates that they 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 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 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. be build and the player continues their turn until they end it.
#Build Road #Build Road
``build road`` Builds a road
During the current players turn, the player can build a new road by giving the 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 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 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. an error message. The player continues their turn until they end it.
#Trade with Bank #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 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 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 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. to give the trade will not be completed and the player may continue their turn.
#Next Player #Next Player
``next player`` Ends a players turn
When the current player has done all the building and trading they wanted and now 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 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 this command the player relinquishes their turn and the next player may start their
turn. turn.
#Quit #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 If a player wants to quit the game they can enter the command quit while it's their
turn to quit the game. turn to quit the game.
#Coordinates
#Class Diagram #Class Diagram

View File

@ -27,7 +27,7 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
*/ */
private final HashMap<Point, Field> fields = new HashMap<>(); private final HashMap<Point, Field> fields = new HashMap<>();
Config.Faction longestRoadFaction = null; Config.Faction longestRoadFaction = null;
int longestRoadLenth = 0; int longestRoadLength = 0;
/** /**
* Method to create the predefined game field from Config. * Method to create the predefined game field from Config.
@ -172,13 +172,13 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
} }
if (currentFaction != null) { if (currentFaction != null) {
longestRoadFaction = currentFaction; longestRoadFaction = currentFaction;
longestRoadLenth = currentRoad; longestRoadLength = currentRoad;
} }
} else { } else {
for (Config.Faction faction : players.keySet()) { for (Config.Faction faction : players.keySet()) {
if (players.get(faction) >= 5 && players.get(faction) > longestRoadLenth) { if (players.get(faction) >= 5 && players.get(faction) > longestRoadLength) {
longestRoadFaction = faction; longestRoadFaction = faction;
longestRoadLenth = players.get(faction); longestRoadLength = players.get(faction);
} }
} }
} }
@ -186,8 +186,8 @@ public class SiedlerBoard extends HexBoard<Config.Land, Settlement, Road, String
} }
//todo javadoc //todo javadoc
public int getLongestRoadLenth() { public int getLongestRoadLength() {
return longestRoadLenth; return longestRoadLength;
} }
/** /**

View File

@ -50,7 +50,7 @@ public class SiedlerGameTest {
board.setEdge(new Point(4, 10), new Point(5, 9), new Road(Config.Faction.BLUE,new Point(4, 10),new Point(5, 9))); board.setEdge(new Point(4, 10), new Point(5, 9), new Road(Config.Faction.BLUE,new Point(4, 10),new Point(5, 9)));
board.setCorner(new Point(3,7),new Settlement(Config.Faction.BLUE,new Point(3,7))); board.setCorner(new Point(3,7),new Settlement(Config.Faction.BLUE,new Point(3,7)));
assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList)); assertEquals(Config.Faction.BLUE, board.getLongestRoadFaction(factionList));
assertEquals(6,board.getLongestRoadLenth()); assertEquals(6,board.getLongestRoadLength());
//todo prüfen ob länge Stimmt. //todo prüfen ob länge Stimmt.
} }