public abstract class WareHolding extends Object
| Type | Property and Description |
|---|---|
javafx.beans.property.IntegerProperty |
occupiedSpace
Space occupied by some tenant
|
| Modifier and Type | Field and Description |
|---|---|
private AmountableProvider |
amountableProvider |
protected ComputablePriceV2 |
computablePrice |
private javafx.beans.property.IntegerProperty |
occupiedSpace
Space occupied by some tenant
|
private LateIntegerBinding |
storedAmountBinding
Binding representing the current load.
|
(package private) NonReplacableMap<IWare,AmountablePrice<IWare>> |
wares
Store the amount of wares in the city in the ware specific sizes
|
| Constructor and Description |
|---|
WareHolding() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNewWare(IWare ware,
int amount)
Add a new ware to the wares list
|
protected void |
bindStoredAmount(javafx.beans.property.ReadOnlyIntegerProperty amountProperty) |
protected int |
computeAVGPrice(IWare ware,
int amount)
Compute the average price for ware that is to be purchased in the specified
amount.
|
protected boolean |
containsWare(IWare ware)
Check if there is an amountable object for this ware
|
int |
getOccupiedSpace()
Gets the value of the property occupiedSpace.
|
AmountablePrice<IWare> |
getWare(IWare ware)
Retrieve the
AmountablePrice of the ware as it is stored in the
holding |
private int |
internalStoredAmountCalculation()
Calculate the stored amount.
|
int |
move(IWare ware,
int amount,
ICitizen player)
Move ware into this holding.
|
javafx.beans.property.IntegerProperty |
occupiedSpaceProperty()
Space occupied by some tenant
|
void |
setOccupiedSpace(int occupiedSpace)
Sets the value of the property occupiedSpace.
|
LateIntegerBinding |
storedAmountBinding() |
protected void |
unbindAllAmounts() |
public javafx.beans.property.IntegerProperty occupiedSpaceProperty
getOccupiedSpace(),
setOccupiedSpace(int)final NonReplacableMap<IWare,AmountablePrice<IWare>> wares
private final javafx.beans.property.IntegerProperty occupiedSpace
@Autowired protected ComputablePriceV2 computablePrice
@Autowired private AmountableProvider amountableProvider
private LateIntegerBinding storedAmountBinding
protected void addNewWare(IWare ware, int amount)
ware - protected void bindStoredAmount(javafx.beans.property.ReadOnlyIntegerProperty amountProperty)
protected void unbindAllAmounts()
public AmountablePrice<IWare> getWare(IWare ware)
AmountablePrice of the ware as it is stored in the
holdingware - to be retrievedpublic int move(IWare ware, int amount, ICitizen player)
ware - to be movedamount - of the ware that is movedplayer - that initiates the moving, may be null, e.g. if the moving is initiated by a cityprotected final boolean containsWare(IWare ware)
ware - protected int computeAVGPrice(IWare ware, int amount)
getWare(IWare).
Subclasses may override this method.ware - for which the average price is to be computedamount - amount that is boughtprivate int internalStoredAmountCalculation()
public LateIntegerBinding storedAmountBinding()
public javafx.beans.property.IntegerProperty occupiedSpaceProperty()
getOccupiedSpace(),
setOccupiedSpace(int)public int getOccupiedSpace()
public void setOccupiedSpace(int occupiedSpace)
Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.