adjust countRoad in SiedlerGame

This commit is contained in:
Andrin Fassbind 2021-12-05 14:12:22 +01:00
parent a79e1eefe3
commit 21f144b294
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@ -508,6 +508,9 @@ public class SiedlerGame {
*/ */
private HashSet<Road> countRoad(Config.Faction faction,Point position,HashSet<Road> roads,boolean add) { private HashSet<Road> countRoad(Config.Faction faction,Point position,HashSet<Road> roads,boolean add) {
List<Road> roadslist = board.getAdjacentEdges(position); List<Road> roadslist = board.getAdjacentEdges(position);
if(board.getCorner(position) != null || board.getCorner(position).getFaction() != faction) {
return roads;
}
Iterator it2 = roads.iterator(); Iterator it2 = roads.iterator();
while(it2.hasNext()) { while(it2.hasNext()) {