-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package ch.epfl.chacun; | ||
|
||
public record ZonePartitions(ZonePartition<Zone.Forest> forests, ZonePartition<Zone.Meadow> meadows, | ||
ZonePartition<Zone.River> rivers, ZonePartition<Zone.Lake> lakes, | ||
ZonePartition<Zone.Water> riverSystems) { | ||
public final static ZonePartitions EMPTY = new ZonePartitions(new ZonePartition<>(), new ZonePartition<>(), new ZonePartition<>(), new ZonePartition<>(), new ZonePartition<>()); | ||
|
||
|
||
public static final class Builder { | ||
|
||
private ZonePartition.Builder<Zone.Forest> forests; | ||
private ZonePartition.Builder<Zone.Meadow> meadows; | ||
private ZonePartition.Builder<Zone.River> rivers; | ||
private ZonePartition.Builder<Zone.Lake> lakes; | ||
|
||
public Builder(ZonePartitions initial) { | ||
this.forests = new ZonePartition.Builder<>(initial.forests); | ||
this.meadows = new ZonePartition.Builder<>(initial.meadows); | ||
this.rivers = new ZonePartition.Builder<>(initial.rivers); | ||
this.lakes = new ZonePartition.Builder<>(initial.lakes); | ||
} | ||
|
||
public void addTile(Tile tile) { | ||
int[] openConnections = new int[10]; | ||
for (TileSide side : tile.sides()) { | ||
for (Zone zone : side.zones()) { | ||
++openConnections[zone.id()]; | ||
} | ||
} | ||
|
||
// if (tile.zones().stream().some) | ||
|
||
} | ||
|
||
} | ||
|
||
} |