IBuilding, ITradingOfficepublic class TradingOffice extends WareHolding implements ITradingOffice
computablePrice| Constructor | Description |
|---|---|
TradingOffice(IPlayer player,
ICity city,
int value,
IStorage storage,
IBalanceSheet lastWeek,
IBalanceSheet thisWeek) |
| Modifier and Type | Method | Description |
|---|---|---|
javafx.beans.property.IntegerProperty |
capacityProperty() |
Retrieve the storage capacity of the trading office and all other storages in the same city
|
protected int |
computeAVGPrice(IWare ware,
int amount) |
Compute the average price for ware that is to be purchased in the specified
amount.
|
void |
destroy() |
Execute when the building is destroyed.
|
java.util.Optional<ISteward> |
getSteward() |
Retrieve the steward of the trading office (manager).
|
int |
getValue() |
Retrieve the value of the building
|
boolean |
hasWeapons() |
check if there are any weapons in storage
|
int |
move(IWare ware,
int amount) |
Add or remove ware from the storage.
|
int |
move(IWare ware,
int amount,
int avgPrice) |
Move the ware into/from the storage with a price attached.
|
int |
move(IWeapon weapon,
int amount) |
/**
Add or remove weapon from the storage.
|
void |
replaceBalanceSheet(IBalanceSheet newWeek) |
Replace the last weeks balance sheet with the current week and
set the new balance sheet for this week.
|
void |
setOwner(IPlayer newOwner) |
Some buildings may be sold to other players.
|
void |
setSteward(ISteward steward) |
Setting the steward.
|
javafx.beans.property.ObjectProperty<ISteward> |
stewardProperty() |
Property holding the steward.
|
javafx.beans.binding.BooleanBinding |
storageManagerPresentBinding() |
Binding indicating the presence of a steward.
|
getOwner, getPropertyTaxgetBalanceLastWeek, getCity, getCurrentWeek, getEstablishedDate, getOccupiedSpace, getOfficeTrading, getStorage, getWare, getWeaponStorage, setOccupiedSpace, storedAmountBindingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNewWare, bindStoredAmount, containsWare, getOccupiedSpace, getWare, move, occupiedSpaceProperty, setOccupiedSpace, storedAmountBinding, unbindAllAmountspublic TradingOffice(IPlayer player, ICity city, int value, IStorage storage, IBalanceSheet lastWeek, IBalanceSheet thisWeek)
@PreDestroy public void destroy()
IBuildingpublic javafx.beans.property.IntegerProperty capacityProperty()
ITradingOfficecapacityProperty in interface ITradingOfficepublic boolean hasWeapons()
ITradingOfficehasWeapons in interface ITradingOfficepublic int move(IWeapon weapon, int amount)
move in interface ITradingOfficeweapon - weapon that should be movedamount - of weapons that should be movedprotected int computeAVGPrice(IWare ware, int amount)
WareHoldingWareHolding.getWare(IWare).
Subclasses may override this method.computeAVGPrice in class WareHoldingware - for which the average price is to be computedamount - amount that is boughtamount of ware.public int move(IWare ware, int amount, int avgPrice)
move in interface ITradingOfficeware - to be movedamount - amount to be movedavgPrice - average price to use on the amount of warepublic java.util.Optional<ISteward> getSteward()
ITradingOfficegetSteward in interface ITradingOfficepublic void setSteward(ISteward steward)
ITradingOfficesetSteward in interface ITradingOfficesteward - to set/unset (null)public javafx.beans.property.ObjectProperty<ISteward> stewardProperty()
ITradingOfficestewardProperty in interface ITradingOfficepublic void replaceBalanceSheet(IBalanceSheet newWeek)
ITradingOfficereplaceBalanceSheet in interface ITradingOfficenewWeek - balance sheet to replace the old one.public int move(IWare ware, int amount)
ITradingOfficemove in interface ITradingOfficeware - to be moved in/out of the trading officeamount - of ware to be moved.public int getValue()
IBuildingpublic javafx.beans.binding.BooleanBinding storageManagerPresentBinding()
ITradingOfficestorageManagerPresentBinding in interface ITradingOfficeCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.