|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||
java.lang.Objectjava.lang.Enum<EWare>
ch.sahits.game.openpatrician.model.product.EWare
public enum EWare
Define the different type of wares that are produced and can be traded.
| Enum Constant Summary | |
|---|---|
BEER
Beer in barrels |
|
BRICK
Brick in burden |
|
CLOTH
Cloth in barrels |
|
FISH
Fish in burden |
|
FISH_OIL
Fish oil in barrels |
|
FUR
Fur in barrels |
|
GRAIN
Grain in burden |
|
HEMP
Hemp in burden |
|
HONEY
Honey in barrels |
|
IRON
Iron in barrels |
|
IRONORE
Iron ore in burden |
|
LEATHER
Leather in barrels |
|
MEAT
Meat in burden |
|
PITCH
Pitch in barrels |
|
POTTERY
Pottery in barrels |
|
SALT
Salt in barrels |
|
SPICE
Spices in barrels |
|
WINE
Wine in barrels |
|
WOOD
Wood in burden |
|
WOOL
Wool in burden |
|
| Field Summary | |
|---|---|
private IPriceCalculation |
calculation
|
private Locale |
locale
|
private int |
maxValueBuy
|
private int |
maxValueSell
|
private int |
minValueBuy
|
private int |
minValueSell
|
private int |
saturation
|
private EWareSize |
size
|
private String |
wareID
|
| Method Summary | |
|---|---|
int |
computeBuyPrice(int availableAmount,
int amountToBuy)
Compute the price for the wares to be bought. |
double |
computePrice(int min,
int max,
int available,
int saturation,
int productionRate,
IPopulationStructure pop,
ECityState state)
Compute the price for one item of the ware. |
int |
computeSellPrice(int availableAmount,
int amountToSell)
Compute the price for the wares to be soled. |
String |
getLocalDisplayName()
|
private String |
getLocalDisplayName(String id)
Retrieve the localized display name for id. |
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()
Retrieve the highest price of this ware when only on item is available |
int |
getMinValueBuy()
Retrieve the value of the minimal payed sum for on unit if an infinitly amount of the ware exists. |
int |
getMinValueSell()
Retrieve the lowest price this ware is soled (at market saturation) |
short |
getSizeAsBarrels()
Retrieve the size of the ware converted into the smallest size unit (barrels) |
static EWare |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static EWare[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ch.sahits.game.openpatrician.model.product.IWare |
|---|
name |
| Enum Constant Detail |
|---|
public static final EWare BEER
public static final EWare IRONORE
public static final EWare IRON
public static final EWare FUR
public static final EWare FISH
public static final EWare MEAT
public static final EWare GRAIN
public static final EWare SPICE
public static final EWare HEMP
public static final EWare WOOD
public static final EWare HONEY
public static final EWare POTTERY
public static final EWare LEATHER
public static final EWare PITCH
public static final EWare SALT
public static final EWare FISH_OIL
public static final EWare CLOTH
public static final EWare WINE
public static final EWare WOOL
public static final EWare BRICK
| Field Detail |
|---|
private final Locale locale
private final EWareSize size
private final int maxValueBuy
private final int minValueBuy
private final int maxValueSell
private final int minValueSell
private final String wareID
private final int saturation
private final IPriceCalculation calculation
| Method Detail |
|---|
public static EWare[] values()
for (EWare c : EWare.values()) System.out.println(c);
public static EWare valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic final String getLocalDisplayName()
getLocalDisplayName in interface IWareprivate String getLocalDisplayName(String id)
id.
id -
public int getMaxValueBuy()
IWare
getMaxValueBuy in interface IWarepublic int getMaxValueSell()
getMaxValueSell in interface IWarepublic int getMinValueSell()
getMinValueSell in interface IWarepublic int getMinValueBuy()
IWare
getMinValueBuy in interface IWare
public int computeSellPrice(int availableAmount,
int amountToSell)
IWareIWare.getMaxValueBuy()
and approaches IWare.getMinValueBuy() assymtotically.
computeSellPrice in interface IWareavailableAmount - Amount of the ware that is availableamountToSell - Amount of ware that is to be sold
public double computePrice(int min,
int max,
int available,
int saturation,
int productionRate,
IPopulationStructure pop,
ECityState state)
computePrice in interface IPriceCalculationmin - the lowest possible price (0 exclusive)max - the highest possible priceavailable - amount of wares that are available in the marketsaturation - amount of items at which the market is saturated (no further price changeproductionRate - amount the city can produce within a weekpop - population structure that may have an influence on the calculated pricestate - state of the city
SimplePriceCalculation.computePrice(int, int, int, int, int, IPopulationStructure, ECityState)
public int computeBuyPrice(int availableAmount,
int amountToBuy)
IWareIWare.getMaxValueBuy()
plus a ware specific constant.
computeBuyPrice in interface IWareavailableAmount - Amount of the ware that is availableamountToBuy - Amount of ware that is to be bought
public final short getSizeAsBarrels()
IWare
getSizeAsBarrels in interface IWarepublic int getMarketSaturation()
IWare
getMarketSaturation in interface IWare
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||