From 1c90d185109c69abab9bc72d8ee6cffbe1b24ba0 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 2 Dec 2021 19:16:28 +0100 Subject: [PATCH] created Method throwDice in Siedler --- src/ch/zhaw/catan/Siedler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index f5dd522..f46161f 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -23,10 +23,7 @@ public class Siedler { 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 + throwDice(game, parser); diceThrown = true; } parser.displayPlayerResourceStock(game.getCurruntPlayerResource()); @@ -70,6 +67,12 @@ public class Siedler { } + private static void throwDice(SiedlerGame game, Parser parser) { + Random random = new Random(); + int thrownDices = random.nextInt(6) + random.nextInt(6); + parser.thrownDices(thrownDices); + game.throwDice(thrownDices); + } private static SiedlerGame foundingPhase(Parser parser) {