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 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 processed
      campaignState - the StratCon state for the contract
      isStartOfMonth - true on the first day of the month, when monthly effects also apply
    • processFacilityOrders

      void processFacilityOrders(StratConTrackState track, Campaign campaign)
      Moves the track's timed facility orders on by a day, completing or abandoning them as due.
      Parameters:
      track - the track whose orders are processed
      campaign - the current campaign
      Since:
      0.51.01
    • processSieges

      void processSieges(StratConTrackState track, Campaign campaign)
      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 processed
      campaign - the current campaign
      Since:
      0.51.01
    • applyMonthlyUpkeep

      void applyMonthlyUpkeep(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.
      Parameters:
      track - the track whose facilities are processed
      campaign - the current campaign
      Since:
      0.51.01
    • processSupply

      void processSupply(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.
      Parameters:
      track - the track whose facilities are processed
      campaign - the current campaign
      isStartOfMonth - true on 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 campaign
      contract - the contract
      campaignState - 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 campaign
      contract - the contract
      campaignState - the StratCon state for the contract
      scenarioCount - 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 scenario
      contract - the contract owning the facility
      destroy - true if the facility should be destroyed
      capture - true if the facility should change hands
    • switchFacilityOwner

      void switchFacilityOwner(StratConFacility facility)
      Transfers ownership of a facility to the opposing side (or its captured definition).
      Parameters:
      facility - the facility whose owner changes