Class PriceUpdate
java.lang.Object
com.fs.starfarer.api.impl.campaign.events.PriceUpdate
- All Implemented Interfaces:
CampaignEventPlugin.PriceUpdatePlugin
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fs.starfarer.api.campaign.events.CampaignEventPlugin.PriceUpdatePlugin
CampaignEventPlugin.PriceUpdatePlugin.PriceType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
float
float
int
int
getRoundedPriceForDisplay
(float priceFlat, float pricePercent) Only call this method when the bonus you want to ignore is not already applied.float
long
getType()
boolean
Checks whether supply/demand is non-trivial.boolean
isSignificant
(float priceFlat, float pricePercent) Checks whether supply/demand is non-trivial.void
updatePrices
(float stockpileMult) void
void
updateType
(float priceFlat, float pricePercent) Only call this method when the bonus you want to ignore is not already applied.
-
Constructor Details
-
PriceUpdate
-
-
Method Details
-
updatePrices
public void updatePrices(float stockpileMult) -
getRoundedPriceForDisplay
public int getRoundedPriceForDisplay()- Specified by:
getRoundedPriceForDisplay
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
getRoundedPriceForDisplay
public int getRoundedPriceForDisplay(float priceFlat, float pricePercent) Only call this method when the bonus you want to ignore is not already applied.- Parameters:
priceFlat
-pricePercent
-- Returns:
-
getDemand
public float getDemand()- Specified by:
getDemand
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
getAvailable
public float getAvailable()- Specified by:
getAvailable
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
updateType
public void updateType()- Specified by:
updateType
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
updateType
public void updateType(float priceFlat, float pricePercent) Only call this method when the bonus you want to ignore is not already applied.- Parameters:
priceFlat
-pricePercent
-
-
getTimestamp
public long getTimestamp()- Specified by:
getTimestamp
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
isSignificant
public boolean isSignificant()Checks whether supply/demand is non-trivial.- Returns:
-
isSignificant
public boolean isSignificant(float priceFlat, float pricePercent) Checks whether supply/demand is non-trivial.- Parameters:
priceMult
-- Returns:
-
getMarket
- Specified by:
getMarket
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
getCommodity
- Specified by:
getCommodity
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
getSupplyPrice
public float getSupplyPrice()- Specified by:
getSupplyPrice
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
getDemandPrice
public float getDemandPrice()- Specified by:
getDemandPrice
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-
getType
- Specified by:
getType
in interfaceCampaignEventPlugin.PriceUpdatePlugin
-