public class WeaponsDealerState extends Object implements IWeaponsDealer
| Modifier and Type | Field and Description |
|---|---|
private Random |
rnd |
private double |
sellValue |
private TransferUtil |
transferUtil |
private Map<IWeapon,javafx.beans.property.IntegerProperty> |
weaponStore |
| Constructor and Description |
|---|
WeaponsDealerState() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addNewWare(IWeapon weapon,
int amount)
Add a new ware to the wares list
|
javafx.beans.property.IntegerProperty |
amountAvailableProperty(EWeapon weapon)
Property representing the amount that can be bought from the dealer.
|
javafx.beans.binding.IntegerBinding |
buyPriceBinding(javafx.beans.property.ObjectProperty<ETransferAmount> amount,
EWeapon weapon)
Binding indicating the buy price.
|
protected boolean |
containsWare(IWeapon weapons)
Check if there is an amountable object for this ware
|
private int |
getWeapon(IWeapon weapon)
Retrieve the amount of the weapon that belongs to the dealer.
|
void |
init() |
int |
move(IWeapon weapon,
int amount)
Move ware into this holding.
|
javafx.beans.binding.IntegerBinding |
sellPriceBinding(EWeapon weapon,
javafx.beans.binding.IntegerBinding amountToSell)
Binding indicating the sell price.
|
@Autowired private Random rnd
@Value(value="${tavern.weapons.dealer.sellvalue.factor}")
private double sellValue
@Autowired private TransferUtil transferUtil
@PostConstruct public void init()
public javafx.beans.binding.IntegerBinding buyPriceBinding(javafx.beans.property.ObjectProperty<ETransferAmount> amount, EWeapon weapon)
IWeaponsDealerbuyPriceBinding in interface IWeaponsDealeramount - the amount of the weapon that is wished to be boughtweapon - that is to be soldpublic javafx.beans.binding.IntegerBinding sellPriceBinding(EWeapon weapon, javafx.beans.binding.IntegerBinding amountToSell)
IWeaponsDealersellPriceBinding in interface IWeaponsDealerweapon - that is to be soldamountToSell - the amount of the weapon that should be sold. This is
the amount the player has in store.private void addNewWare(IWeapon weapon, int amount)
weapon - to be storedamount - to be storedpublic int move(IWeapon weapon, int amount)
move in interface IWeaponsDealerweapon - to be movedamount - of the ware that is movedprotected final boolean containsWare(IWeapon weapons)
weapons - to be checkedprivate int getWeapon(IWeapon weapon)
weapon - type of weaponpublic javafx.beans.property.IntegerProperty amountAvailableProperty(EWeapon weapon)
IWeaponsDealeramountAvailableProperty in interface IWeaponsDealerweapon - that is to be soldCopyright © 2011-2015 Sahits GmbH. All Rights Reserved.