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 TypeMethodDescriptionvoidapplyPeriodicEffects(StratConTrackState track, StratConCampaignState campaignState, boolean isStartOfMonth) Applies the periodic (daily, and where relevant monthly) effects of the facilities on a track.voidswitchFacilityOwner(StratConFacility facility) Transfers ownership of a facility to the opposing side (or its captured definition).voidupdateFacilityForScenario(AtBScenario scenario, AtBContract 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
-
updateFacilityForScenario
void updateFacilityForScenario(AtBScenario scenario, AtBContract 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
-