diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index 6c39048..f5dd522 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -5,6 +5,7 @@ import org.beryx.textio.TextIoFactory; import org.beryx.textio.TextTerminal; import java.util.HashMap; +import java.util.Random; import static ch.zhaw.catan.Command.*; import static ch.zhaw.catan.Command.QUIT; @@ -17,13 +18,22 @@ public class Siedler { Parser parser = new Parser(); SiedlerGame game = foundingPhase(parser); boolean running = true; + boolean diceThrown = false; while (running){ parser.displayGameboard(game.getBoard().getTextView()); parser.playerTurn(game.getCurrentPlayerFaction()); + if(!diceThrown) { + Random random = new Random(); + int thrownDices = random.nextInt(6) + random.nextInt(6); + parser.thrownDices(thrownDices); + //todo resourcen auszahlen + diceThrown = true; + } parser.displayPlayerResourceStock(game.getCurruntPlayerResource()); switch (parser.getAction()) { case NEXTPLAYER: game.switchToNextPlayer(); + diceThrown = false; break; case BUILDSETTLEMENT: parser.giveCoordinatesForStructures(Config.Structure.SETTLEMENT);