|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IWare
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 than SATURATION items
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 the MIN price. This is a further
simplification because the price normally drops further if there are much more items available.
The curve would bee leveling out at SATURATION and then dropping further.
ABS_MIN: the absolut minimum is the minimal sell price at SATURATION.
(MAX-MIN)*(MIN+1) --------------------- + ABS_MIN ex*15/(SATURATION*2)+MIN
| Method Summary | |
|---|---|
int |
computeBuyPrice(int availableAmount,
int amountToBuy)
Compute the price for the wares to be bought. |
int |
computeSellPrice(int availableAmount,
int amountToSell)
Compute the price for the wares to be soled. |
String |
getLocalDisplayName()
|
int |
getMarketSaturation()
Retrieve the amount of units which is considered infinite. |
int |
getMaxValueBuy()
Retrieve the value that is maximal payed for one unit of this ware if no ware is available. |
int |
getMaxValueSell()
|
int |
getMinValueBuy()
Retrieve the value of the minimal payed sum for on unit if an infinitly amount of the ware exists. |
int |
getMinValueSell()
|
short |
getSizeAsBarrels()
Retrieve the size of the ware converted into the smallest size unit (barrels) |
String |
name()
As this interface is implemented by an enumeration add this method |
| Method Detail |
|---|
String getLocalDisplayName()
int getMaxValueBuy()
int getMinValueBuy()
int computeSellPrice(int availableAmount,
int amountToSell)
getMaxValueBuy()
and approaches getMinValueBuy() assymtotically.
availableAmount - Amount of the ware that is availableamountToSell - Amount of ware that is to be sold
int computeBuyPrice(int availableAmount,
int amountToBuy)
getMaxValueBuy()
plus a ware specific constant.
availableAmount - Amount of the ware that is availableamountToBuy - Amount of ware that is to be bought
short getSizeAsBarrels()
int getMarketSaturation()
int getMinValueSell()
int getMaxValueSell()
String name()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||