Class StratConReinforcementStrategy
java.lang.Object
mekhq.campaign.digitalGM.stratCon.StratConReinforcementStrategy
- All Implemented Interfaces:
IReinforcementStrategy
Default StratCon implementation of
IReinforcementStrategy. Every method delegates to the existing static
logic on StratConRulesManager, so this class introduces the overridable seam without moving any behaviour.- Since:
- 0.51.01
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmegamek.common.rolls.TargetRollcalculateReinforcementTargetNumber(Person commandLiaison, AtBContract contract, int baseTargetNumber) Calculates the target number a reinforcement attempt must beat.getReinforcementType(int forceID, StratConTrackState trackState, Campaign campaign, StratConCampaignState campaignState) Determines a force's eligibility to reinforce, given its current commitments.processReinforcementDeployment(Formation formation, StratConRulesManager.ReinforcementEligibilityType reinforcementType, StratConCampaignState campaignState, StratConScenario scenario, Campaign campaign, int reinforcementTargetNumber, boolean isGMReinforcement) Processes a reinforcement deployment attempt.processReinforcementDeployment(Formation formation, StratConRulesManager.ReinforcementEligibilityType reinforcementType, StratConCampaignState campaignState, StratConScenario scenario, Campaign campaign, int reinforcementTargetNumber, boolean isGMReinforcement, boolean isInstantlyDeployed) Processes a reinforcement deployment attempt, optionally bypassing the roll for an instant deployment.
-
Constructor Details
-
StratConReinforcementStrategy
public StratConReinforcementStrategy()
-
-
Method Details
-
getReinforcementType
public StratConRulesManager.ReinforcementEligibilityType getReinforcementType(int forceID, StratConTrackState trackState, Campaign campaign, StratConCampaignState campaignState) Description copied from interface:IReinforcementStrategyDetermines a force's eligibility to reinforce, given its current commitments.- Specified by:
getReinforcementTypein interfaceIReinforcementStrategy- Parameters:
forceID- the force in questiontrackState- the track the reinforcement would occur oncampaign- the active campaigncampaignState- the StratCon state for the contract- Returns:
- the reinforcement eligibility category for the force
-
calculateReinforcementTargetNumber
public megamek.common.rolls.TargetRoll calculateReinforcementTargetNumber(@Nullable Person commandLiaison, AtBContract contract, int baseTargetNumber) Description copied from interface:IReinforcementStrategyCalculates the target number a reinforcement attempt must beat.- Specified by:
calculateReinforcementTargetNumberin interfaceIReinforcementStrategy- Parameters:
commandLiaison- the liaison influencing the roll, if anycontract- the active contractbaseTargetNumber- the base target number before modifiers- Returns:
- the assembled reinforcement target roll
-
processReinforcementDeployment
public StratConRulesManager.ReinforcementResultsType processReinforcementDeployment(Formation formation, StratConRulesManager.ReinforcementEligibilityType reinforcementType, StratConCampaignState campaignState, StratConScenario scenario, Campaign campaign, int reinforcementTargetNumber, boolean isGMReinforcement) Description copied from interface:IReinforcementStrategyProcesses a reinforcement deployment attempt.- Specified by:
processReinforcementDeploymentin interfaceIReinforcementStrategy- Parameters:
formation- the reinforcing formationreinforcementType- the force's reinforcement eligibilitycampaignState- the StratCon state for the contractscenario- the scenario being reinforcedcampaign- the active campaignreinforcementTargetNumber- the target number to beatisGMReinforcement-trueif the deployment is GM-forced- Returns:
- the result of the reinforcement attempt
-
processReinforcementDeployment
public StratConRulesManager.ReinforcementResultsType processReinforcementDeployment(Formation formation, StratConRulesManager.ReinforcementEligibilityType reinforcementType, StratConCampaignState campaignState, StratConScenario scenario, Campaign campaign, int reinforcementTargetNumber, boolean isGMReinforcement, boolean isInstantlyDeployed) Description copied from interface:IReinforcementStrategyProcesses a reinforcement deployment attempt, optionally bypassing the roll for an instant deployment.- Specified by:
processReinforcementDeploymentin interfaceIReinforcementStrategy- Parameters:
formation- the reinforcing formationreinforcementType- the force's reinforcement eligibilitycampaignState- the StratCon state for the contractscenario- the scenario being reinforcedcampaign- the active campaignreinforcementTargetNumber- the target number to beatisGMReinforcement-trueif the deployment is GM-forcedisInstantlyDeployed-trueto deploy immediately, skipping the roll- Returns:
- the result of the reinforcement attempt
-