Package mekhq.campaign.market.unitMarket
Class DisabledUnitMarket
java.lang.Object
mekhq.campaign.market.unitMarket.AbstractUnitMarket
mekhq.campaign.market.unitMarket.DisabledUnitMarket
This is a completely empty unit market, which is used when the market is disabled.
-
Field Summary
Fields inherited from class mekhq.campaign.market.unitMarket.AbstractUnitMarket
resources -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOffers(Campaign campaign, int number, UnitMarketType market, int unitType, Faction faction, int quality, int priceTarget) This adds a number of unit offersaddSingleUnit(Campaign campaign, UnitMarketType market, int unitType, Faction faction, int quality, int percent) voidfillFromXML(Node wn, Campaign campaign, megamek.Version version) This method fills the market based on the supplied XML node.voidgenerateUnitOffers(Campaign campaign) This is the primary Unit Market generation method, which is how the market specified generates unit offersintgenerateWeight(Campaign campaign, int unitType, Faction faction) voidprocessNewDay(Campaign campaign) This is the primary method for processing the Unit Market.voidremoveUnitOffers(Campaign campaign) This is the primary Unit Market removal method, which is how the market specified removes unit offersvoidsetOffers(List<UnitMarketOffer> offers) voidwriteToXML(PrintWriter pw, int indent) This writes the Unit Market to XMLMethods inherited from class mekhq.campaign.market.unitMarket.AbstractUnitMarket
addSingleUnit, addSingleUnit, addSingleUnit, generateTransitDuration, getMethod, getOffers, parseXMLNode, writeBodyToXML, writeRefreshReport
-
Constructor Details
-
DisabledUnitMarket
public DisabledUnitMarket()
-
-
Method Details
-
setOffers
- Overrides:
setOffersin classAbstractUnitMarket
-
processNewDay
Description copied from class:AbstractUnitMarketThis is the primary method for processing the Unit Market. It is executed as part ofCampaign.newDay()- Specified by:
processNewDayin classAbstractUnitMarket- Parameters:
campaign- the campaign to process the Unit Market new day using
-
generateUnitOffers
Description copied from class:AbstractUnitMarketThis is the primary Unit Market generation method, which is how the market specified generates unit offers- Specified by:
generateUnitOffersin classAbstractUnitMarket- 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:
addSingleUnitin classAbstractUnitMarket- Parameters:
campaign- the campaign to use to generate the unitmarket- the market type the unit is being offered inunitType- the unit type to generate the unit withfaction- the faction to generate the unit fromquality- the quality to generate the unit atpercent- 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:AbstractUnitMarketThis adds a number of unit offers- Specified by:
addOffersin classAbstractUnitMarket- Parameters:
campaign- the campaign to add the offers based onnumber- 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 generatepriceTarget- the target number used to determine the percent
-
generateWeight
- 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
Description copied from class:AbstractUnitMarketThis is the primary Unit Market removal method, which is how the market specified removes unit offers- Specified by:
removeUnitOffersin classAbstractUnitMarket- Parameters:
campaign- the campaign to use in determining the offers to remove
-
writeToXML
Description copied from class:AbstractUnitMarketThis writes the Unit Market to XML- Overrides:
writeToXMLin classAbstractUnitMarket- Parameters:
pw- the PrintWriter to write toindent- the base indent level to write at
-
fillFromXML
Description copied from class:AbstractUnitMarketThis method fills the market based on the supplied XML node. The market is initialized as empty before this is called.- Overrides:
fillFromXMLin classAbstractUnitMarket- Parameters:
wn- the node to fill the market fromcampaign- the campaign the market is being parsed as part ofversion- the version of the market being parsed
-