forked from SteamWar/SteamWar
Change some instance creations to casts
This commit is contained in:
+1
-1
@@ -176,7 +176,7 @@ public class DynamicRegionSystem implements RegionSystem {
|
||||
public Stream<Pair<DynamicRegion, NeighbourDirection>> getNeighbours(Region region) {
|
||||
return getNeighbours(region, false, true, regionMap.values())
|
||||
.filter(data -> data.getKey() instanceof DynamicRegion)
|
||||
.map(data -> new Pair<>((DynamicRegion) data.getKey(), data.getValue()));
|
||||
.map(data -> (Pair<DynamicRegion, NeighbourDirection>) (Pair) data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public abstract class DynamicRegion implements Region {
|
||||
public final void updateNeighbours() {
|
||||
List<Pair<PathRegion, NeighbourDirection>> list = DynamicRegionSystem.INSTANCE.getNeighbours(this)
|
||||
.filter(data -> data.getKey() instanceof PathRegion)
|
||||
.map(data -> new Pair<>((PathRegion) data.getKey(), data.getValue()))
|
||||
.map(data -> (Pair<PathRegion, NeighbourDirection>)(Pair) data)
|
||||
.toList();
|
||||
// Calculate Garden State for all neighbouring PathRegions
|
||||
list.forEach(data -> {
|
||||
|
||||
Reference in New Issue
Block a user