Package mekhq.campaign.market.unitMarket
Class AtBMonthlyUnitMarket
java.lang.Object
mekhq.campaign.market.unitMarket.AbstractUnitMarket
mekhq.campaign.market.unitMarket.AtBMonthlyUnitMarket
-
Field Summary
Fields inherited from class mekhq.campaign.market.unitMarket.AbstractUnitMarket
resources -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOffers(Campaign campaign, int num, UnitMarketType market, int unitType, Faction faction, int quality, int priceModifier) This adds a number of unit offersvoidgenerateUnitOffers(Campaign campaign) Generates unit offers based on market type, unit type, and rarityprotected intgenerateWeight(Campaign campaign, int unitType, Faction faction) This generates a random weight using the static weight generation methods in this marketvoidprocessNewDay(Campaign campaign) This market runs monthly, so it only executes removal and generation on the first day of the monthvoidremoveUnitOffers(Campaign campaign) The AtB Unit Market clears all offers from the unit market each monthMethods inherited from class mekhq.campaign.market.unitMarket.AbstractUnitMarket
addSingleUnit, addSingleUnit, addSingleUnit, addSingleUnit, fillFromXML, generateTransitDuration, getMethod, getOffers, parseXMLNode, setOffers, writeBodyToXML, writeRefreshReport, writeToXML
-
Constructor Details
-
AtBMonthlyUnitMarket
public AtBMonthlyUnitMarket()
-
-
Method Details
-
processNewDay
This market runs monthly, so it only executes removal and generation on the first day of the month- Specified by:
processNewDayin classAbstractUnitMarket- Parameters:
campaign- the campaign to process the Unit Market new day using
-
generateUnitOffers
Generates unit offers based on market type, unit type, and rarity- Specified by:
generateUnitOffersin classAbstractUnitMarket- 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:AbstractUnitMarketThis adds a number of unit offers- Specified by:
addOffersin classAbstractUnitMarket- Parameters:
campaign- the campaign to add the offers based onnum- the number of units to generatemarket- the unit market type the unit is part ofunitType- the unit type to generatefaction- 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 generatepriceModifier- the target number used to determine the percent
-
generateWeight
This generates a random weight using the static weight generation methods in this market- Specified by:
generateWeightin classAbstractUnitMarket- Parameters:
campaign- the campaign to generate the unit weight based onunitType- the unit type to determine the format of weight to generatefaction- the faction to generate the weight for- Returns:
- the generated weight
-
removeUnitOffers
The AtB Unit Market clears all offers from the unit market each month- Specified by:
removeUnitOffersin classAbstractUnitMarket- Parameters:
campaign- the campaign to use in determining the offers to remove
-