From 51e61a8e003cfd5399ff64045978ed3da81dfc7f Mon Sep 17 00:00:00 2001 From: schrom01 Date: Sat, 4 Dec 2021 23:29:19 +0100 Subject: [PATCH] Set Variable citiesToUse in Constructor of Player --- src/ch/zhaw/catan/Player.java | 1 + src/ch/zhaw/catan/SiedlerGame.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ch/zhaw/catan/Player.java b/src/ch/zhaw/catan/Player.java index 79f6e29..aa608b2 100644 --- a/src/ch/zhaw/catan/Player.java +++ b/src/ch/zhaw/catan/Player.java @@ -19,6 +19,7 @@ public class Player { this.faction = faction; roadsToUse = Config.Structure.ROAD.getStockPerPlayer(); settlementsToUse = Config.Structure.SETTLEMENT.getStockPerPlayer(); + citiesToUse = Config.Structure.CITY.getStockPerPlayer(); //Ressourcen initialisiern resources = new HashMap<>(); for(Config.Resource resource : Config.Resource.values()) { diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 07f69ee..ba34a58 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -278,7 +278,7 @@ public class SiedlerGame { return false; } //2. Check if Settlement has already been built - Settlement atCurrentPosition = board.getCorner(position); + Settlement atCurrentPosition = board.getCorner(position); //todo prüfen ob Siedlung von richtiger Faction und nicht Stadt if (atCurrentPosition == null){ return false; } @@ -288,7 +288,8 @@ public class SiedlerGame { } //4.Insert City into the map. board.setCorner(position,new City(allPlayers.get(activePlayer).getFaction())); - return false; + return true; + } /**