- 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:
@@ -217,6 +217,7 @@ public class PowerPlayController {
|
||||
private void getIntersects(){
|
||||
Place starSystem = getCheckedSystem();
|
||||
Collection<Place> controlls = getControlSystems();
|
||||
controlls.remove(starSystem);
|
||||
result.clear();
|
||||
if (starSystem != null && !controlls.isEmpty()){
|
||||
Collection<PowerPlayAnalyzator.IntersectData> intersects = analyzator.getIntersects(starSystem, controlls);
|
||||
@@ -348,7 +349,7 @@ public class PowerPlayController {
|
||||
Place place = systemsStatEntry.getKey();
|
||||
if (place.getPower() == power) {
|
||||
PowerPlayAnalyzator.StarSystemsStat systemStat = systemsStatEntry.getValue();
|
||||
builder.append(String.format(Localization.getString("powerplay.text.contest.systems"), place.getName(), systemStat.getExploited(), systemStat.getIntersect(), systemStat.getContest()));
|
||||
builder.append(String.format(Localization.getString("powerplay.text.contest.systems"), place.getName(), systemStat.getExploited(), place.getIncome(), systemStat.getIntersect(), systemStat.getContest()));
|
||||
builder.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,16 +291,16 @@ powerplay.label.power.state=State:
|
||||
powerplay.label.populationSumm=Summ populations:
|
||||
powerplay.text.line=-------------------------------------------
|
||||
powerplay.text.detail=Current stat:\n\
|
||||
Income: %4d \u041A\u041A Upkeep: %4.0f \u041A\u041A Contested: %4d \u041A\u041A\n\
|
||||
Our exploited: %4d \u041A\u041A Others exploited: %4d \u041A\u041A\n\
|
||||
Our blocked: %4d \u041A\u041A Others blocked: %4d \u041A\u041A Total: %4.0f \u041A\u041A
|
||||
Income: %4d CC Upkeep: %4.0f CC Contested: %4d CC\n\
|
||||
Our exploited: %4d CC Others exploited: %4d CC\n\
|
||||
Our blocked: %4d CC Others blocked: %4d CC Total: %4.0f CC
|
||||
powerplay.text.summary.title=After expansion complete:
|
||||
powerplay.text.summary=\
|
||||
Income: %4d \u041A\u041A Upkeep: %4.0f \u041A\u041A Expansion cost: %4.0f \u041A\u041A\n\
|
||||
Contested: %4d \u041A\u041A Our exploited: %4d \u041A\u041A Total: %4.0f \u041A\u041A
|
||||
Income: %4d CC Upkeep: %4.0f CC Expansion cost: %4.0f CC\n\
|
||||
Contested: %4d CC Our exploited: %4d CC Total: %4.0f CC
|
||||
powerplay.text.contest.title=Contested:
|
||||
powerplay.text.contest.powers=%-20s - %4d \u041A\u041A, Intersected: %4d \u041A\u041A, Contested: %4d \u041A\u041A
|
||||
powerplay.text.contest.systems=\ %19s - %4d \u041A\u041A, Intersected: %4d \u041A\u041A, Contested: %4d \u041A\u041A
|
||||
powerplay.text.contest.powers=%-20s - %4d CC, Intersected: %4d CC, Contested: %4d CC
|
||||
powerplay.text.contest.systems=\ %19s - %4d CC, Income: %4d CC, Intersected: %4d CC, Contested: %4d CC
|
||||
powerplay.result.title=Analyze result
|
||||
powerplay.column.intersecting=Intersect
|
||||
powerplay.column.intersectCount=Intersect count
|
||||
|
||||
@@ -295,7 +295,7 @@ powerplay.text.summary.title=\u041F\u043E\u0441\u043B\u0435 \u0432\u0437\u044F\u
|
||||
powerplay.text.summary=\u0414\u043E\u0445\u043E\u0434: %4d \u041A\u041A \u0421\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435: %4.0f \u041A\u041A \u0421\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u044D\u043A\u0441\u043F\u0430\u043D\u0441\u0438\u0438: %4.0f \u041A\u041A\n\u041E\u0441\u043F\u0430\u0440\u0438\u0432\u0430\u0435\u043C\u044B\u0445: %4d \u041A\u041A \u042D\u043A\u0441\u043B\u0443\u0430\u0442\u0438\u0440\u0443\u0435\u043C\u044B\u0445 \u043D\u0430\u043C\u0438: %4d \u041A\u041A \u0418\u0442\u043E\u0433\u043E: %4.0f \u041A\u041A
|
||||
powerplay.text.contest.title=\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0430 \u043F\u043E \u043E\u0441\u043F\u0430\u0440\u0438\u0432\u0430\u0435\u043C\u044B\u043C:
|
||||
powerplay.text.contest.powers=%-20s - %4d \u041A\u041A, \u041F\u0435\u0440\u0435\u0441\u0435\u043A\u0430\u044E\u0449\u0438\u0445\u0441\u044F: %4d \u041A\u041A, \u041E\u0441\u043F\u0430\u0440\u0438\u0432\u0430\u0435\u043C\u044B\u0445: %4d \u041A\u041A
|
||||
powerplay.text.contest.systems=\ %19s - %4d \u041A\u041A, \u041F\u0435\u0440\u0435\u0441\u0435\u043A\u0430\u044E\u0449\u0438\u0445\u0441\u044F: %4d \u041A\u041A, \u041E\u0441\u043F\u0430\u0440\u0438\u0432\u0430\u0435\u043C\u044B\u0445: %4d \u041A\u041A
|
||||
powerplay.text.contest.systems=\ %19s - %4d \u041A\u041A, \u0414\u043E\u0445\u043E\u0434: %4d \u041A\u041A, \u041F\u0435\u0440\u0435\u0441\u0435\u043A\u0430\u044E\u0449\u0438\u0445\u0441\u044F: %4d \u041A\u041A, \u041E\u0441\u043F\u0430\u0440\u0438\u0432\u0430\u0435\u043C\u044B\u0445: %4d \u041A\u041A
|
||||
powerplay.result.title=\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u043D\u0430\u043B\u0438\u0437\u0430
|
||||
powerplay.column.intersecting=\u041F\u0435\u0440\u0435\u0441\u0435\u043A\u0430\u0435\u0442\u0441\u044F \u0441
|
||||
powerplay.column.intersectCount=\u041F\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043D\u0438\u0439
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user