Skip to content

Commit

Permalink
Refactor Tile.zones()
Browse files Browse the repository at this point in the history
  • Loading branch information
Max committed Apr 1, 2024
1 parent e415bd8 commit 8917efa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ch/epfl/chacun/Tile.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ public Set<Zone> zones() {
Set<Zone> sideZones = sideZones();
Set<Zone> zones = new HashSet<>(sideZones);
for (Zone zone : sideZones) {
if (zone instanceof Zone.River river) {
if (river.hasLake())
zones.add(river.lake());
}
if (zone instanceof Zone.River river && river.hasLake())
zones.add(river.lake());
}
return zones;
}
Expand Down

0 comments on commit 8917efa

Please sign in to comment.