Interface CommodityOnMarketAPI
public interface CommodityOnMarketAPI
- Author:
- Alex Mosolov Copyright 2018 Fractal Softworks, LLC
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addToStockpile
(float quantity) void
addTradeMod
(String source, float quantity, float days) Can result in both positive and negative econ-unit changes.void
addTradeModMinus
(String source, float quantity, float days) Only negative econ-unit changes (but value may be positive; just gets clamped to 0).void
addTradeModPlus
(String source, float quantity, float days) Only positive econ-unit changes (but value may be negative; just gets clamped to 0).int
float
tradeMod + modPlus if positive + modMinus if negative.int
Quantity that can be sold at a higher price.int
int
Quantity that can be bought at a lower price.int
getGreed()
float
getId()
int
int
float
getModValueForQuantity
(float quantity) int
Returns net bought/sold, minus what was used to change economy units available on market.float
getQuantityForModValue
(float modValue) float
Actual quantity in "inventory" units.float
boolean
boolean
isFuel()
boolean
boolean
boolean
isMeta()
boolean
boolean
boolean
void
void
removeFromStockpile
(float quantity) void
setDemandLegal
(boolean isDemandLegal) void
setMaxDemand
(int maxDemand) void
setMaxSupply
(int maxSupply) void
setStockpile
(float stockpile) void
setSupplyLegal
(boolean isSupplyLegal) void
-
Method Details
-
getId
String getId() -
getGreed
MutableStat getGreed() -
getGreedValue
float getGreedValue() -
getCommodity
CommoditySpecAPI getCommodity() -
getStockpile
float getStockpile() -
setStockpile
void setStockpile(float stockpile) -
addToStockpile
void addToStockpile(float quantity) -
removeFromStockpile
void removeFromStockpile(float quantity) -
getMarket
MarketAPI getMarket() -
getDemandClass
String getDemandClass() -
getDemand
MarketDemandAPI getDemand() -
getUtilityOnMarket
float getUtilityOnMarket() -
isPersonnel
boolean isPersonnel() -
isFuel
boolean isFuel() -
isNonEcon
boolean isNonEcon() -
getMaxSupply
int getMaxSupply() -
setMaxSupply
void setMaxSupply(int maxSupply) -
getMaxDemand
int getMaxDemand() -
setMaxDemand
void setMaxDemand(int maxDemand) -
updateMaxSupplyAndDemand
void updateMaxSupplyAndDemand() -
getAvailable
int getAvailable() -
getAvailableStat
MutableStatWithTempMods getAvailableStat() -
getTradeMod
MutableStatWithTempMods getTradeMod()Actual quantity in "inventory" units. Gets translated into econ-unit-scale "market units" and applied to the available quantity.- Returns:
-
getTradeModPlus
MutableStatWithTempMods getTradeModPlus() -
getTradeModMinus
MutableStatWithTempMods getTradeModMinus() -
reapplyEventMod
void reapplyEventMod() -
getModValueForQuantity
float getModValueForQuantity(float quantity) -
isIllegal
boolean isIllegal() -
isIllegalAssumePrimary
boolean isIllegalAssumePrimary() -
getQuantityForModValue
float getQuantityForModValue(float modValue) -
getExportIncome
int getExportIncome() -
isSupplyLegal
boolean isSupplyLegal() -
setSupplyLegal
void setSupplyLegal(boolean isSupplyLegal) -
isDemandLegal
boolean isDemandLegal() -
setDemandLegal
void setDemandLegal(boolean isDemandLegal) -
addTradeMod
Can result in both positive and negative econ-unit changes.- Parameters:
source
-quantity
-days
-
-
addTradeModPlus
Only positive econ-unit changes (but value may be negative; just gets clamped to 0).- Parameters:
source
-quantity
-days
-
-
addTradeModMinus
Only negative econ-unit changes (but value may be positive; just gets clamped to 0).- Parameters:
source
-quantity
-days
-
-
getCombinedTradeModQuantity
float getCombinedTradeModQuantity()tradeMod + modPlus if positive + modMinus if negative.- Returns:
-
isMeta
boolean isMeta() -
getDemandValue
int getDemandValue() -
getCommodityMarketData
CommodityMarketDataAPI getCommodityMarketData() -
getDeficitQuantity
int getDeficitQuantity()Quantity that can be sold at a higher price.- Returns:
-
getExcessQuantity
int getExcessQuantity()Quantity that can be bought at a lower price.- Returns:
-
getPlayerTradeNetQuantity
int getPlayerTradeNetQuantity()Returns net bought/sold, minus what was used to change economy units available on market. For example, if 400 units of supplies are sold by to a colony, this method will return 0. If 399 units are sold, it will return 399. >0 means player sold stuff recently, <0 means bought.- Returns:
-
getPlayerSupplyPriceMod
StatBonus getPlayerSupplyPriceMod() -
getPlayerDemandPriceMod
StatBonus getPlayerDemandPriceMod()
-