Archived
0

use isBlocked

This commit is contained in:
Mo
2016-12-22 19:17:45 +03:00
parent 07c8132372
commit 347b554299
3 changed files with 3 additions and 2 deletions

View File

@@ -210,7 +210,7 @@ public class PowerPlayController {
if (hq == null || entry.getPowerState().isContested() || entry.getPower() != hq.getPower()) {
contested += cc;
}
if (hq != null && entry.getPowerState().isExploited() && entry.getPower() == hq.getPower()) {
if (hq != null && (entry.getPowerState().isExploited() || entry.getPowerState().isBlocked()) && entry.getPower() == hq.getPower()) {
intersected += cc;
}
Set<POWER> powers = entry.getControllingSystems().stream().map(Place::getPower).collect(Collectors.toSet());

View File

@@ -173,7 +173,7 @@ public class PowerPlayAnalyzator {
public static Stream<IntersectData> getNearExpansions(Stream<Place> starSystems, Collection<Place> centers, double maxDistance){
IntersectsMapper mapper = new IntersectsMapper(centers, maxDistance, false, true);
return starSystems.filter(new FarDropper(centers, maxDistance))
.filter(p -> p.getPowerState() == POWER_STATE.EXPANSION)
.filter(p -> p.getPowerState().isExpansion())
.map(mapper)
.sorted(new DistanceComparator());
}

View File

@@ -18,4 +18,5 @@ public enum POWER_STATE {
public boolean isContested(){
return this == CONTESTED;
}
public boolean isBlocked() { return this == BLOCKED;}
}