Package mekhq.campaign.digitalGM
Interface IFacilityStrategy
- All Known Implementing Classes:
NoOpFacilityStrategy,StratConFacilityStrategy
public interface IFacilityStrategy
Strategy for map facilities — applying their periodic effects, updating them when a scenario resolves, and
transferring ownership. Mapless (and, by extension, Singles) play has no facility map at all, so its implementation
is a no-op; the legacy engine gated the periodic call behind
if (!isUseStratConMapless) and skipped facility
placement entirely, so the remaining operations are already inert there.
The method signatures mirror the corresponding static entry points on
StratConRulesManager; the default StratCon
implementation delegates to them, so the rules themselves are unchanged.
- Since:
- 0.51.01
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyMonthlyUpkeep(StratConTrackState track, Campaign campaign) Gives the enemy facilities on a track their monthly upkeep: repairs and reinforcements; and charges the upkeep of the facilities the player's side has built there.voidapplyPeriodicEffects(StratConTrackState track, StratConCampaignState campaignState, boolean isStartOfMonth) Applies the periodic (daily, and where relevant monthly) effects of the facilities on a track.intlaunchCounterattacks(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState, int scenarioCount) Turns some of the day's due ordinary scenarios into enemy counterattacks on facilities held by the player or their employer.voidprocessEnemyActivity(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState) Runs the enemy's contract-wide facility activity for the day, such as sending engineers to build outposts.voidprocessFacilityOrders(StratConTrackState track, Campaign campaign) Moves the track's timed facility orders on by a day, completing or abandoning them as due.voidprocessSieges(StratConTrackState track, Campaign campaign) Settles the week's sieges on a track: support points, garrison losses, surrenders and sorties.voidprocessSupply(StratConTrackState track, Campaign campaign, boolean isStartOfMonth) Checks which facilities on a track are cut off from their supply lines, and applies what being cut off does.voidswitchFacilityOwner(StratConFacility facility) Transfers ownership of a facility to the opposing side (or its captured definition).voidupdateFacilityForScenario(AtBScenario scenario, AbstractContract contract, boolean destroy, boolean capture) Updates the facility associated with a resolved scenario, destroying or capturing it as required.
-
Method Details
-
applyPeriodicEffects
void applyPeriodicEffects(StratConTrackState track, StratConCampaignState campaignState, boolean isStartOfMonth) Applies the periodic (daily, and where relevant monthly) effects of the facilities on a track.- Parameters:
track- the track whose facilities are processedcampaignState- the StratCon state for the contractisStartOfMonth-trueon the first day of the month, when monthly effects also apply
-
processFacilityOrders
Moves the track's timed facility orders on by a day, completing or abandoning them as due.- Parameters:
track- the track whose orders are processedcampaign- the current campaign- Since:
- 0.51.01
-
processSieges
Settles the week's sieges on a track: support points, garrison losses, surrenders and sorties. Called on Mondays.- Parameters:
track- the track whose sieges are processedcampaign- the current campaign- Since:
- 0.51.01
-
applyMonthlyUpkeep
Gives the enemy facilities on a track their monthly upkeep: repairs and reinforcements; and charges the upkeep of the facilities the player's side has built there.- Parameters:
track- the track whose facilities are processedcampaign- the current campaign- Since:
- 0.51.01
-
processSupply
Checks which facilities on a track are cut off from their supply lines, and applies what being cut off does.- Parameters:
track- the track whose facilities are processedcampaign- the current campaignisStartOfMonth-trueon the first day of the month- Since:
- 0.51.01
-
processEnemyActivity
void processEnemyActivity(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState) Runs the enemy's contract-wide facility activity for the day, such as sending engineers to build outposts.- Parameters:
campaign- the current campaigncontract- the contractcampaignState- the StratCon state for the contract- Since:
- 0.51.01
-
launchCounterattacks
int launchCounterattacks(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState, int scenarioCount) Turns some of the day's due ordinary scenarios into enemy counterattacks on facilities held by the player or their employer.- Parameters:
campaign- the current campaigncontract- the contractcampaignState- the StratCon state for the contractscenarioCount- how many ordinary scenarios are due today- Returns:
- how many became counterattacks, and so should not be generated as ordinary scenarios
- Since:
- 0.51.01
-
updateFacilityForScenario
void updateFacilityForScenario(AtBScenario scenario, AbstractContract contract, boolean destroy, boolean capture) Updates the facility associated with a resolved scenario, destroying or capturing it as required.- Parameters:
scenario- the resolved scenariocontract- the contract owning the facilitydestroy-trueif the facility should be destroyedcapture-trueif the facility should change hands
-
switchFacilityOwner
Transfers ownership of a facility to the opposing side (or its captured definition).- Parameters:
facility- the facility whose owner changes
-