Archived
0

- print income for contested systems

- don't add to max profit result excluded systems
- don't check to intersect checked system with self
This commit is contained in:
iMoHax
2017-02-01 14:21:52 +03:00
parent 242d67b390
commit 445c9c0180
4 changed files with 12 additions and 10 deletions

View File

@@ -143,6 +143,7 @@ public class PowerPlayAnalyzator {
public static Stream<IntersectData> getMaxProfit(Stream<Place> starSystems, Place headquarter, Collection<Place> centers, double radius, double maxDistance){
Collection<Place> candidates = new ArrayList<>();
starSystems.filter(p ->p.getPowerState() == POWER_STATE.NONE && p.getDistance(headquarter) <= maxDistance)
.filter(p -> !centers.contains(p))
.forEach(candidates::add);
IntersectsMapper candidatesMapper = new IntersectsMapper(candidates, radius, false, true);
IntersectsMapper centersMapper = new IntersectsMapper(centers, radius*2, false, true);