public class WeaponsDealerState extends Object implements IWeaponsDealer
| Modifier and Type | Field and Description |
|---|---|
private static org.apache.logging.log4j.Logger |
LOGGER |
private DependentPropertyInitializer |
propertyInitializer |
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.
|
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.
|
private static final org.apache.logging.log4j.Logger LOGGER
@Autowired private Random rnd
@Autowired private DependentPropertyInitializer propertyInitializer
@DependentValue(value="tavern.weapons.dealer.sellvalue.factor") private double sellValue
@Autowired private TransferUtil transferUtil
@PostConstruct public void init()
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-2017 Sahits GmbH. All Rights Reserved.