change in Main Method

changed Method getWinner and getCurrentPlayerWinpoints
This commit is contained in:
schrom01
2021-12-03 09:37:19 +01:00
parent 8a494b247b
commit 8811410e44
2 changed files with 19 additions and 20 deletions
+13 -5
View File
@@ -13,13 +13,15 @@ public class Siedler {
boolean running = true;
boolean diceThrown = false;
while (running){
Config.Faction currentPlayerFaction = game.getCurrentPlayerFaction();
parser.displayGameboard(game.getBoard().getTextView());
parser.playerTurn(game.getCurrentPlayerFaction());
parser.playerTurn(currentPlayerFaction);
if(!diceThrown) {
throwDice(game, parser);
diceThrown = true;
}
parser.displayPlayerInfo(game.getCurrentPlayerResource(),game.getWinPoints().get(game.getCurrentPlayerFaction()));
parser.displayPlayerInfo(game.getCurrentPlayerResource(), game.getCurrentPlayerWinpoints());
switch (parser.getAction()) {
case NEXTPLAYER:
Config.Faction winner = game.getWinner();
@@ -33,15 +35,21 @@ public class Siedler {
break;
case BUILDSETTLEMENT:
parser.giveCoordinatesForStructures(Config.Structure.SETTLEMENT);
game.buildSettlement(parser.getPoint());
if(!game.buildSettlement(parser.getPoint())){
parser.errorMessage();
}
break;
case BUILDCITY:
parser.giveCoordinatesForStructures(Config.Structure.CITY);
game.buildCity(parser.getPoint());
if(!game.buildCity(parser.getPoint())){
parser.errorMessage();
}
break;
case BUILDROAD:
parser.giveCoordinatesForStructures(Config.Structure.ROAD);
game.buildRoad(parser.getPoint(), parser.getPoint());
if(game.buildRoad(parser.getPoint(), parser.getPoint())){
parser.errorMessage();
}
break;
case TRADEWITHBANK:
Config.Resource offer = parser.trade(true);