diff --git a/src/ch/zhaw/catan/Parser.java b/src/ch/zhaw/catan/Parser.java index eb15669..933532d 100644 --- a/src/ch/zhaw/catan/Parser.java +++ b/src/ch/zhaw/catan/Parser.java @@ -25,6 +25,13 @@ public class Parser { textTerminal.println(gameboard); } + public void displayPlayerResourceStock(HashMap curruntPlayerResource){ + textTerminal.println("You own the follwing Resources"); + for(Config.Resource resource : curruntPlayerResource.keySet()){ + textTerminal.println(resource.name() + ":" + curruntPlayerResource.get(resource)); + } + } + public HashMap gameStart(){ HashMap gameStartValues = new HashMap<>(); gameStartValues.put("NumberOfPlayers", textIO.newIntInputReader().withMinVal(2).withMaxVal(4).read("Number of players:")); diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index 7f21096..6c39048 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -16,11 +16,11 @@ public class Siedler { //Spiel erstellen Parser parser = new Parser(); SiedlerGame game = foundingPhase(parser); - boolean running = true; while (running){ + parser.displayGameboard(game.getBoard().getTextView()); parser.playerTurn(game.getCurrentPlayerFaction()); - + parser.displayPlayerResourceStock(game.getCurruntPlayerResource()); switch (parser.getAction()) { case NEXTPLAYER: game.switchToNextPlayer(); diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 23dbe75..9559984 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -130,6 +130,10 @@ public class SiedlerGame { return allPlayers.get(activePlayer).getSpecificResource(resource); } + public HashMap getCurruntPlayerResource() { + return allPlayers.get(activePlayer).getResources(); + } + /** * Places a settlement in the founder's phase (phase II) of the game. *