Class ContractAutomation

java.lang.Object
mekhq.campaign.market.contractMarket.ContractAutomation

public class ContractAutomation extends Object
The ContractAutomation class provides a suite of methods used in automating actions when a contract starts.

This includes actions like mothballing of units, transit to mission location and the automated activation of units when arriving in the system.

  • Constructor Details

    • ContractAutomation

      public ContractAutomation()
  • Method Details

    • contractStartPrompt

      public static void contractStartPrompt(Campaign campaign, Contract contract)
      Main function to initiate a sequence of automated tasks when a contract is started. The tasks include prompt and execution for unit mothballing, calculating and starting the journey to the target system.
      Parameters:
      campaign - The current campaign.
      contract - Selected contract.
    • performAutomatedMothballing

      public static List<UUID> performAutomatedMothballing(Campaign campaign)
      This method identifies all non-mothballed units within a campaign that are currently assigned to a Force. Those units are then GM Mothballed.
      Parameters:
      campaign - The current campaign.
      Returns:
      A list of all newly mothballed units.
    • performAutomatedActivation

      public static void performAutomatedActivation(Campaign campaign)
      Perform automated activation of units. Identifies all units that were mothballed previously and are now needing activation. The activation action is executed for each unit, and they are returned to their prior Force if it still exists.
      Parameters:
      campaign - The current campaign.
    • outOfContractMothballAutomation

      public static void outOfContractMothballAutomation(Campaign campaign)