changes in mainMethod
added Method displayPlayerResourceStock to Parser
This commit is contained in:
parent
7c84f7f600
commit
0c63540616
|
@ -25,6 +25,13 @@ public class Parser {
|
||||||
textTerminal.println(gameboard);
|
textTerminal.println(gameboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void displayPlayerResourceStock(HashMap<Config.Resource, Integer> curruntPlayerResource){
|
||||||
|
textTerminal.println("You own the follwing Resources");
|
||||||
|
for(Config.Resource resource : curruntPlayerResource.keySet()){
|
||||||
|
textTerminal.println(resource.name() + ":" + curruntPlayerResource.get(resource));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public HashMap<String, Integer> gameStart(){
|
public HashMap<String, Integer> gameStart(){
|
||||||
HashMap<String, Integer> gameStartValues = new HashMap<>();
|
HashMap<String, Integer> gameStartValues = new HashMap<>();
|
||||||
gameStartValues.put("NumberOfPlayers", textIO.newIntInputReader().withMinVal(2).withMaxVal(4).read("Number of players:"));
|
gameStartValues.put("NumberOfPlayers", textIO.newIntInputReader().withMinVal(2).withMaxVal(4).read("Number of players:"));
|
||||||
|
|
|
@ -16,11 +16,11 @@ public class Siedler {
|
||||||
//Spiel erstellen
|
//Spiel erstellen
|
||||||
Parser parser = new Parser();
|
Parser parser = new Parser();
|
||||||
SiedlerGame game = foundingPhase(parser);
|
SiedlerGame game = foundingPhase(parser);
|
||||||
|
|
||||||
boolean running = true;
|
boolean running = true;
|
||||||
while (running){
|
while (running){
|
||||||
|
parser.displayGameboard(game.getBoard().getTextView());
|
||||||
parser.playerTurn(game.getCurrentPlayerFaction());
|
parser.playerTurn(game.getCurrentPlayerFaction());
|
||||||
|
parser.displayPlayerResourceStock(game.getCurruntPlayerResource());
|
||||||
switch (parser.getAction()) {
|
switch (parser.getAction()) {
|
||||||
case NEXTPLAYER:
|
case NEXTPLAYER:
|
||||||
game.switchToNextPlayer();
|
game.switchToNextPlayer();
|
||||||
|
|
|
@ -130,6 +130,10 @@ public class SiedlerGame {
|
||||||
return allPlayers.get(activePlayer).getSpecificResource(resource);
|
return allPlayers.get(activePlayer).getSpecificResource(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<Resource, Integer> getCurruntPlayerResource() {
|
||||||
|
return allPlayers.get(activePlayer).getResources();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Places a settlement in the founder's phase (phase II) of the game.
|
* Places a settlement in the founder's phase (phase II) of the game.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue