Skip to content

Commit ba61224

Browse files
committed
fix markers occupants
1 parent c2924d5 commit ba61224

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ch/epfl/chacun/gui/BoardUI.java

+11
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,17 @@ public static Node create(
233233
))
234234
.toList();
235235
group.getChildren().addAll(potentialOccupantsNodes);
236+
} else if (
237+
oldPlacedTile != null && placedTile == null
238+
) {
239+
// this is the case where the game is reset
240+
// we remove all the nodes that are not the tile image
241+
// (markers, occupants, etc.)
242+
group.getChildren().removeAll(
243+
group.getChildren()
244+
.stream().filter(node -> !node.equals(imageView))
245+
.toList()
246+
);
236247
}
237248
});
238249
}

0 commit comments

Comments
 (0)