completed founding Phase
This commit is contained in:
parent
b75afdc6a0
commit
fb38fc07b0
|
@ -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<String, Integer> 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();
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue