Interface IWare
-
- All Superinterfaces:
IAmountable,ITradable
- All Known Implementing Classes:
EWare
public interface IWare extends IAmountable, ITradable
Interface defining a ware. The ware provides general information on the item it represents. It also provides methods to compute the sell and buy price of the ware based on the available amount. The price computation uses the following constants:
MAX: the maximum price for the item if it is not available in the market. Here the function has a glitch for the buy price: If no item is available it cannot be sold and the price is therefore 0 (infinity would be logical correct but is not very understandable in the game context).
MIN: the minimal price of the item if more thanSATURATIONitems are available in the market. As more items are available in the market the price approaches this value asymptoticly.
SATURATION: amount of items when the the need is fullfilled. If there are more items available in the market than needed all have theMINprice. This is a further simplification because the price normally drops further if there are much more items available. The curve would bee leveling out atSATURATIONand then dropping further.
ABS_MIN: the absolut minimum is the minimal sell price atSATURATION.
(MAX-MIN)*(MIN+1) --------------------- + ABS_MIN e^(x*15/(SATURATION*2))+MIN
- Author:
- Andi Hotz, (c) Sahits GmbH, 2011 Created on Jan 15, 2011
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetAiMaxBuyAbsolute()Retrieve the maximum absolute amount of the ware that should be loaded on a ship.doublegetAiMaxBuyPercentage()Retrieve the amount in percentage the AI should buy of a certain ware when compared to the ship size.intgetMaxBuyPriceModerate()Retrieve the moderate max buy price of the ware.intgetMaxBuyPriceOffensive()Retrieve the offensive max buy price of the ware.intgetMaxBuyPriceRabiat()Retrieve the rabiat max buy price for the ware.intgetMinSellPriceModerate()Retrieve the moderate min sell price of the ware.intgetMinSellPriceOffensive()Retrieve the offensive min sell price of the ware.intgetMinSellPriceRabiat()Retrieve the rabiat max min sell for the ware.shortgetSizeAsBarrels()Retrieve the size of the ware converted into the smallest size unit (barrels)java.lang.StringgetWareID()Retrieve the ware id that can be used for localisation.booleanisBarrelSizedWare()Check if the ware size is barrel or not.-
Methods inherited from interface ch.sahits.game.openpatrician.model.product.ITradable
getBuyCurve, getMarketSaturationForBuying, getMarketSaturationForSelling, getMaxValueBuy, getMaxValueSell, getMinValueBuy, getMinValueSell, getSellCurve, name
-
-
-
-
Method Detail
-
getSizeAsBarrels
short getSizeAsBarrels()
Retrieve the size of the ware converted into the smallest size unit (barrels)- Returns:
- size of the ware in barrles
-
isBarrelSizedWare
boolean isBarrelSizedWare()
Check if the ware size is barrel or not.- Returns:
- true if the ware is stored in barrels
-
getMaxBuyPriceModerate
int getMaxBuyPriceModerate()
Retrieve the moderate max buy price of the ware.- Returns:
- maximum buy price
-
getMaxBuyPriceOffensive
int getMaxBuyPriceOffensive()
Retrieve the offensive max buy price of the ware.- Returns:
- maximum buy price
-
getMaxBuyPriceRabiat
int getMaxBuyPriceRabiat()
Retrieve the rabiat max buy price for the ware.- Returns:
- maximum buy price
-
getMinSellPriceModerate
int getMinSellPriceModerate()
Retrieve the moderate min sell price of the ware.- Returns:
- minimum sell price
-
getMinSellPriceOffensive
int getMinSellPriceOffensive()
Retrieve the offensive min sell price of the ware.- Returns:
- minimum sell price
-
getMinSellPriceRabiat
int getMinSellPriceRabiat()
Retrieve the rabiat max min sell for the ware.- Returns:
- minimum sell price
-
getAiMaxBuyPercentage
double getAiMaxBuyPercentage()
Retrieve the amount in percentage the AI should buy of a certain ware when compared to the ship size.- Returns:
- maximum percentage buy amount
-
getAiMaxBuyAbsolute
int getAiMaxBuyAbsolute()
Retrieve the maximum absolute amount of the ware that should be loaded on a ship.- Returns:
- maximum absolute buy amount
-
getWareID
java.lang.String getWareID()
Retrieve the ware id that can be used for localisation.- Returns:
-
-