City, TradingOfficepublic abstract class WareHolding
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
protected ComputablePriceV2 |
computablePrice |
| Constructor | Description |
|---|---|
WareHolding() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
addNewWare(IWare ware,
int amount) |
Add a new ware to the wares list
|
protected void |
bindStoredAmount(javafx.beans.property.ReadOnlyIntegerProperty amountProperty) |
Bind the
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() |
|
AmountablePrice<IWare> |
getWare(IWare ware) |
Retrieve the
AmountablePrice of the ware as it is stored in the
holding |
int |
move(IWare ware,
int amount,
ICitizen player) |
Move ware into this holding.
|
javafx.beans.property.IntegerProperty |
occupiedSpaceProperty() |
|
void |
setOccupiedSpace(int occupiedSpace) |
|
LateIntegerBinding |
storedAmountBinding() |
|
protected void |
unbindAllAmounts() |
Unbind all bound amounts.
|
@Autowired protected ComputablePriceV2 computablePrice
protected void addNewWare(IWare ware, int amount)
ware - to be addedamount - of ware to be added.protected void bindStoredAmount(javafx.beans.property.ReadOnlyIntegerProperty amountProperty)
amountProperty.amountProperty - to be bound.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 - to be checked for containemntprotected 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 boughtamount of ware.public LateIntegerBinding storedAmountBinding()
public javafx.beans.property.IntegerProperty occupiedSpaceProperty()
public int getOccupiedSpace()
public void setOccupiedSpace(int occupiedSpace)
Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.