public enum EWeapon extends Enum<EWeapon> implements IWeapon
| Enum Constant and Description |
|---|
BALLISTA_BIG |
BALLISTA_SMALL |
BOMBARD |
BOW |
CANNON |
CROSSBOW |
HAND_WEAPON |
MUSKET |
SWORD |
TREBUCHET_BIG |
TREBUCHET_SMALL |
| Modifier and Type | Field and Description |
|---|---|
private ComputablePrice |
computablePrice |
private int |
maxValueBuy |
private int |
maxValueSell |
private int |
minValueBuy |
private int |
minValueSell |
private int |
saturation |
| Modifier and Type | Method and Description |
|---|---|
int |
computeBuyPrice(int availableAmount,
int amountToBuy)
Deprecated.
|
int |
computeSellPrice(int availableAmount,
int amountToSell)
Deprecated.
|
static EWeapon |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EWeapon[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EWeapon SWORD
public static final EWeapon BOW
public static final EWeapon CROSSBOW
public static final EWeapon MUSKET
public static final EWeapon BALLISTA_SMALL
public static final EWeapon TREBUCHET_SMALL
public static final EWeapon BALLISTA_BIG
public static final EWeapon TREBUCHET_BIG
public static final EWeapon BOMBARD
public static final EWeapon CANNON
public static final EWeapon HAND_WEAPON
private final int maxValueBuy
private final int minValueBuy
private final int maxValueSell
private final int minValueSell
private final int saturation
private ComputablePrice computablePrice
public static EWeapon[] values()
for (EWeapon c : EWeapon.values()) System.out.println(c);
public static EWeapon valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null@Deprecated public int computeSellPrice(int availableAmount, int amountToSell)
IWeapon#getMaxValueBuy()
and approaches #getMinValueBuy() assymtotically.computeSellPrice in interface IWeaponavailableAmount - Amount of the weapon that is availableamountToSell - Amount of weapon that is to be sold@Deprecated public int computeBuyPrice(int availableAmount, int amountToBuy)
IWeapon#getMaxValueBuy()
plus a weapon specific constant.computeBuyPrice in interface IWeaponavailableAmount - Amount of the weapon that is availableamountToBuy - Amount of weapon that is to be boughtCopyright © 2011-2015 Sahits GmbH. All Rights Reserved.