diff --git a/src/ch/zhaw/catan/Siedler.java b/src/ch/zhaw/catan/Siedler.java index 2b24797..9798c46 100644 --- a/src/ch/zhaw/catan/Siedler.java +++ b/src/ch/zhaw/catan/Siedler.java @@ -6,6 +6,9 @@ import org.beryx.textio.TextTerminal; import java.util.HashMap; +import static ch.zhaw.catan.Command.*; +import static ch.zhaw.catan.Command.QUIT; + public class Siedler { public static void main(String[] args) { @@ -14,11 +17,29 @@ public class Siedler { Parser parser = new Parser(); SiedlerGame game = foundingPhase(parser); - parser.getAction(); - - - //Spielfeld ausgeben - + boolean running = true; + while (running){ + parser.playerTurn(game.getCurrentPlayerFaction()); + switch (parser.getAction()) { + case NEXTPLAYER: + game.switchToNextPlayer(); + break; + case BUILDSETTLEMENT: + game. + break; + case BUILDCITY: + break; + case BUILDROAD: + break; + case TRADEWITHBANK: + break; + case QUIT: + running = false; + break; + default: + parser.errorMessage(); + } + } @@ -32,12 +53,14 @@ public class Siedler { private static SiedlerGame foundingPhase(Parser parser) { HashMap gameInfo = parser.gameStart(); SiedlerGame game = new SiedlerGame(gameInfo.get("NumberOfWinPoints"), gameInfo.get("NumberOfPlayers")); + for(int player = 1; player <= gameInfo.get("NumberOfPlayers"); player++){ buildStructuresInFoundingPhase(game, parser, false); if(player < gameInfo.get("NumberOfPlayers")){ game.switchToPreviousPlayer(); } } + for(int player = 1; player <= gameInfo.get("NumberOfPlayers"); player++){ buildStructuresInFoundingPhase(game, parser, true); game.switchToNextPlayer(); diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 9041b88..23dbe75 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -220,11 +220,6 @@ public class SiedlerGame { return true; } - public boolean buildSettlementFoundation(Point position) { - //todo implement - return true; - } - /** * Builds a city at the specified position on the board. *