Class AtBMonthlyUnitMarket

java.lang.Object
mekhq.campaign.market.unitMarket.AbstractUnitMarket
mekhq.campaign.market.unitMarket.AtBMonthlyUnitMarket

public class AtBMonthlyUnitMarket extends AbstractUnitMarket
  • Constructor Details

    • AtBMonthlyUnitMarket

      public AtBMonthlyUnitMarket()
  • Method Details

    • processNewDay

      public void processNewDay(Campaign campaign)
      This market runs monthly, so it only executes removal and generation on the first day of the month
      Specified by:
      processNewDay in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to process the Unit Market new day using
    • generateUnitOffers

      public void generateUnitOffers(Campaign campaign)
      Generates unit offers based on market type, unit type, and rarity
      Specified by:
      generateUnitOffers in class AbstractUnitMarket
      Parameters:
      campaign - The ongoing campaign
    • addOffers

      public void addOffers(Campaign campaign, int num, UnitMarketType market, int unitType, @Nullable Faction faction, int quality, int priceModifier)
      Description copied from class: AbstractUnitMarket
      This adds a number of unit offers
      Specified by:
      addOffers in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to add the offers based on
      num - the number of units to generate
      market - the unit market type the unit is part of
      unitType - the unit type to generate
      faction - the faction to add the offers for, or null. If null, that must be handled within this method before any generated offers may be added to the market.
      quality - the quality of the unit to generate
      priceModifier - the target number used to determine the percent
    • generateWeight

      protected int generateWeight(Campaign campaign, int unitType, Faction faction)
      This generates a random weight using the static weight generation methods in this market
      Specified by:
      generateWeight in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to generate the unit weight based on
      unitType - the unit type to determine the format of weight to generate
      faction - the faction to generate the weight for
      Returns:
      the generated weight
    • removeUnitOffers

      public void removeUnitOffers(Campaign campaign)
      The AtB Unit Market clears all offers from the unit market each month
      Specified by:
      removeUnitOffers in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to use in determining the offers to remove