From c45471c3373942a7664b5b17175c27ba4562b950 Mon Sep 17 00:00:00 2001 From: Speedy Gonzalez Date: Fri, 3 Dec 2021 09:57:42 +0100 Subject: [PATCH] Added method buildCity. --- src/ch/zhaw/catan/SiedlerGame.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 8dfece8..f9fd45b 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -243,8 +243,10 @@ public class SiedlerGame { return false; } //2. Check if Settlement has already been built - Settlement atCurrentPosition = (Settlement) board.getCorner(position); - + Settlement atCurrentPosition = board.getCorner(position); + if (atCurrentPosition == null){ + return false; + } //3. Can player build a City. if(!allPlayers.get(activePlayer).buildCity()){ return false;