diff --git a/MekHQ/src/mekhq/campaign/force/Force.java b/MekHQ/src/mekhq/campaign/force/Force.java index 14c1808b6d..23b41fe256 100644 --- a/MekHQ/src/mekhq/campaign/force/Force.java +++ b/MekHQ/src/mekhq/campaign/force/Force.java @@ -129,9 +129,7 @@ public Camouflage getCamouflage() { } public Camouflage getCamouflageOrElse(final Camouflage camouflage) { - return getCamouflage().hasDefaultCategory() - ? ((getParentForce() == null) ? camouflage : getParentForce().getCamouflageOrElse(camouflage)) - : getCamouflage(); + return getCamouflage().hasDefaultCategory() ? ((getParentForce() == null) ? camouflage : getParentForce().getCamouflageOrElse(camouflage)) : getCamouflage(); } public void setCamouflage(Camouflage camouflage) { @@ -434,11 +432,7 @@ public void setOverrideForceCommanderID(UUID overrideForceCommanderID) { * @return a list of UUIDs representing the eligible commanders */ public List getEligibleCommanders(Campaign campaign) { - List eligibleCommanders = getUnits().stream() - .map(unitId -> campaign.getUnit(unitId).getCommander() != null ? - campaign.getUnit(unitId).getCommander().getId() : null) - .filter(Objects::nonNull) - .collect(Collectors.toList()); + List eligibleCommanders = getUnits().stream().map(unitId -> campaign.getUnit(unitId).getCommander() != null ? campaign.getUnit(unitId).getCommander().getId() : null).filter(Objects::nonNull).collect(Collectors.toList()); // this means the force contains no Units, so we check against the leaders of the sub-forces if (eligibleCommanders.isEmpty()) { @@ -521,16 +515,10 @@ public void removeSubForce(int id) { */ public List updateForceIconOperationalStatus(final Campaign campaign) { // First, update all subForces, collecting their unit statuses into a single list - final List statuses = getSubForces().stream() - .flatMap(subForce -> subForce.updateForceIconOperationalStatus(campaign).stream()) - .collect(Collectors.toList()); + final List statuses = getSubForces().stream().flatMap(subForce -> subForce.updateForceIconOperationalStatus(campaign).stream()).collect(Collectors.toList()); // Then, Add the units assigned to this force - statuses.addAll(getUnits().stream() - .map(campaign::getUnit) - .filter(Objects::nonNull) - .map(LayeredForceIconOperationalStatus::determineLayeredForceIconOperationalStatus) - .toList()); + statuses.addAll(getUnits().stream().map(campaign::getUnit).filter(Objects::nonNull).map(LayeredForceIconOperationalStatus::determineLayeredForceIconOperationalStatus).toList()); // Can only update the icon for LayeredForceIcons, but still need to return the processed // units for parent force updates @@ -547,12 +535,7 @@ public List updateForceIconOperationalStatus( final int index = (int) Math.round(statuses.stream().mapToInt(Enum::ordinal).sum() / (statuses.size() * 1.0)); final LayeredForceIconOperationalStatus status = LayeredForceIconOperationalStatus.values()[index]; ((LayeredForceIcon) getForceIcon()).getPieces().put(LayeredForceIconLayer.SPECIAL_MODIFIER, new ArrayList<>()); - ((LayeredForceIcon) getForceIcon()).getPieces().get(LayeredForceIconLayer.SPECIAL_MODIFIER) - .add(new ForcePieceIcon( - LayeredForceIconLayer.SPECIAL_MODIFIER, - MekHQ.getMHQOptions().getNewDayForceIconOperationalStatusStyle().getPath(), - status.getFilename()) - ); + ((LayeredForceIcon) getForceIcon()).getPieces().get(LayeredForceIconLayer.SPECIAL_MODIFIER).add(new ForcePieceIcon(LayeredForceIconLayer.SPECIAL_MODIFIER, MekHQ.getMHQOptions().getNewDayForceIconOperationalStatusStyle().getPath(), status.getFilename())); } return statuses; @@ -708,8 +691,7 @@ public Vector getAllChildren(Campaign campaign) { } } } - units.sort((u1, u2) -> ((Comparable) u2.getCommander().getRankNumeric()) - .compareTo(u1.getCommander().getRankNumeric())); + units.sort((u1, u2) -> ((Comparable) u2.getCommander().getRankNumeric()).compareTo(u1.getCommander().getRankNumeric())); children.addAll(units); children.addAll(unmannedUnits);