From 7c84f7f600c9e0271edde71832ea94e8048ef28d Mon Sep 17 00:00:00 2001 From: schrom01 Date: Thu, 2 Dec 2021 18:47:00 +0100 Subject: [PATCH] changes in mainMethod --- src/ch/zhaw/catan/Siedler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index 7bafff8..7f21096 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -20,6 +20,7 @@ public class Siedler { boolean running = true; while (running){ parser.playerTurn(game.getCurrentPlayerFaction()); + switch (parser.getAction()) { case NEXTPLAYER: game.switchToNextPlayer(); @@ -37,8 +38,11 @@ public class Siedler { game.buildRoad(parser.getPoint(), parser.getPoint()); break; case TRADEWITHBANK: - Config.Resource toGive = parser.trade(true); - Config.Resource toGet = parser.trade(false); + Config.Resource offer = parser.trade(true); + Config.Resource want = parser.trade(false); + if(!game.tradeWithBankFourToOne(offer, want)){ + parser.errorMessage(); + } break; case QUIT: running = false;