Class DisabledUnitMarket

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

public class DisabledUnitMarket extends AbstractUnitMarket
This is a completely empty unit market, which is used when the market is disabled.
  • Constructor Details

    • DisabledUnitMarket

      public DisabledUnitMarket()
  • Method Details

    • setOffers

      public void setOffers(List<UnitMarketOffer> offers)
      Overrides:
      setOffers in class AbstractUnitMarket
    • processNewDay

      public void processNewDay(Campaign campaign)
      Description copied from class: AbstractUnitMarket
      This is the primary method for processing the Unit Market. It is executed as part of Campaign.newDay()
      Specified by:
      processNewDay in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to process the Unit Market new day using
    • generateUnitOffers

      public void generateUnitOffers(Campaign campaign)
      Description copied from class: AbstractUnitMarket
      This is the primary Unit Market generation method, which is how the market specified generates unit offers
      Specified by:
      generateUnitOffers in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to generate the unit offers for
    • addSingleUnit

      @Nullable public String addSingleUnit(Campaign campaign, UnitMarketType market, int unitType, Faction faction, int quality, int percent)
      Overrides:
      addSingleUnit in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to use to generate the unit
      market - the market type the unit is being offered in
      unitType - the unit type to generate the unit with
      faction - the faction to generate the unit from
      quality - the quality to generate the unit at
      percent - the percentage of the original unit cost the unit will be offered at
      Returns:
      the name of the unit that has been added to the market, or null if none were added
    • addOffers

      public void addOffers(Campaign campaign, int number, UnitMarketType market, int unitType, Faction faction, int quality, int priceTarget)
      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
      number - 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
      priceTarget - the target number used to determine the percent
    • generateWeight

      public int generateWeight(Campaign campaign, int unitType, Faction faction)
      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)
      Description copied from class: AbstractUnitMarket
      This is the primary Unit Market removal method, which is how the market specified removes unit offers
      Specified by:
      removeUnitOffers in class AbstractUnitMarket
      Parameters:
      campaign - the campaign to use in determining the offers to remove
    • writeToXML

      public void writeToXML(PrintWriter pw, int indent)
      Description copied from class: AbstractUnitMarket
      This writes the Unit Market to XML
      Overrides:
      writeToXML in class AbstractUnitMarket
      Parameters:
      pw - the PrintWriter to write to
      indent - the base indent level to write at
    • fillFromXML

      public void fillFromXML(Node wn, Campaign campaign, megamek.Version version)
      Description copied from class: AbstractUnitMarket
      This method fills the market based on the supplied XML node. The market is initialized as empty before this is called.
      Overrides:
      fillFromXML in class AbstractUnitMarket
      Parameters:
      wn - the node to fill the market from
      campaign - the campaign the market is being parsed as part of
      version - the version of the market being parsed