Change some instance creations to casts

This commit is contained in:
2026-03-06 21:30:08 +01:00
parent 27deebd570
commit 5188d37327
2 changed files with 2 additions and 2 deletions
@@ -176,7 +176,7 @@ public class DynamicRegionSystem implements RegionSystem {
public Stream<Pair<DynamicRegion, NeighbourDirection>> getNeighbours(Region region) { public Stream<Pair<DynamicRegion, NeighbourDirection>> getNeighbours(Region region) {
return getNeighbours(region, false, true, regionMap.values()) return getNeighbours(region, false, true, regionMap.values())
.filter(data -> data.getKey() instanceof DynamicRegion) .filter(data -> data.getKey() instanceof DynamicRegion)
.map(data -> new Pair<>((DynamicRegion) data.getKey(), data.getValue())); .map(data -> (Pair<DynamicRegion, NeighbourDirection>) (Pair) data);
} }
@Override @Override
@@ -54,7 +54,7 @@ public abstract class DynamicRegion implements Region {
public final void updateNeighbours() { public final void updateNeighbours() {
List<Pair<PathRegion, NeighbourDirection>> list = DynamicRegionSystem.INSTANCE.getNeighbours(this) List<Pair<PathRegion, NeighbourDirection>> list = DynamicRegionSystem.INSTANCE.getNeighbours(this)
.filter(data -> data.getKey() instanceof PathRegion) .filter(data -> data.getKey() instanceof PathRegion)
.map(data -> new Pair<>((PathRegion) data.getKey(), data.getValue())) .map(data -> (Pair<PathRegion, NeighbourDirection>)(Pair) data)
.toList(); .toList();
// Calculate Garden State for all neighbouring PathRegions // Calculate Garden State for all neighbouring PathRegions
list.forEach(data -> { list.forEach(data -> {