From 21f144b2944e3822cfb87d7f6a90c38903465c90 Mon Sep 17 00:00:00 2001 From: Andrin Fassbind Date: Sun, 5 Dec 2021 14:12:22 +0100 Subject: [PATCH] adjust countRoad in SiedlerGame --- .idea/misc.xml | 2 +- src/ch/zhaw/catan/SiedlerGame.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 1029788..b573818 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 207bf94..1e5afc7 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -508,6 +508,9 @@ public class SiedlerGame { */ private HashSet countRoad(Config.Faction faction,Point position,HashSet roads,boolean add) { List roadslist = board.getAdjacentEdges(position); + if(board.getCorner(position) != null || board.getCorner(position).getFaction() != faction) { + return roads; + } Iterator it2 = roads.iterator(); while(it2.hasNext()) {