Package mekhq.campaign.mission.utilities
Class ContractUtilities
java.lang.Object
mekhq.campaign.mission.utilities.ContractUtilities
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic intcalculateBaseNumberOfRequiredLances(Campaign campaign, boolean isCadreDuty) Calculates the number of lances used for this contract, based on [campaign].static intCalculates the number of units required for this contract, based on [campaign].static intgetEffectiveNumUnits(Campaign campaign) Calculates the effective number of units available in the given campaign based on unit types and roles.
- 
Constructor Details- 
ContractUtilitiespublic ContractUtilities()
 
- 
- 
Method Details- 
calculateBaseNumberOfRequiredLancesCalculates the number of lances used for this contract, based on [campaign].- Parameters:
- campaign- The campaign to reference.
- isCadreDuty-- trueif- CombatRole.CADREshould be considered a combat role
- Returns:
- The number of lances required.
 
- 
calculateBaseNumberOfUnitsRequiredInCombatTeamsCalculates the number of units required for this contract, based on [campaign].- Parameters:
- campaign- The campaign to reference.
- Returns:
- The number of combat units present.
 
- 
getEffectiveNumUnitsCalculates the effective number of units available in the given campaign based on unit types and roles.This method iterates through all combat teams in the specified campaign, ignoring combat teams with the auxiliary role. For each valid combat team, it retrieves the associated force and evaluates all units within that force. The unit contribution to the total is determined based on its type. See CombatTeam.getSize(Campaign)Units that aren’t associated with a valid combat team or can’t be fetched due to missing data are ignored. The final result is returned as an integer by flooring the calculated total. - Parameters:
- campaign- the campaign containing the combat teams and units to evaluate
- Returns:
- the effective number of units as an integer
 
 
-