public class TradingOffice extends WareHolding implements ITradingOffice
| Type | Property and Description |
|---|---|
javafx.beans.property.IntegerProperty |
capacity
Retrieve the storage capacity of the trading office and all other storages in the same city
|
javafx.beans.property.ObjectProperty<ISteward> |
steward
Property holding the steward.
|
occupiedSpaceProperty| Modifier and Type | Field and Description |
|---|---|
private IBalanceSheet |
balanceLastWeek |
private int |
baseValue
Value of the building (building costs
|
private BuildingFactory |
buildingFactory |
private javafx.beans.property.IntegerProperty |
capacity |
private ICity |
city
Reference to the city the trading office is located in
|
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private IBalanceSheet |
currentWeek |
private PlayerInteractionFactory |
interactionFactory |
private static int |
MAX_CAPACITY
Maximal capacity of the trading office in barrels
|
private IAutomatedTrading |
officeTrading |
private IPlayer |
owner
Reference to the player
|
private javafx.beans.property.ObjectProperty<ISteward> |
steward |
private IStorage |
storage |
private javafx.beans.binding.BooleanBinding |
storageManagerPresent |
private PeriodicalTimeUpdateFactory |
updateFactory |
private IWeaponStorage |
weaponStorage
Weapons storage
|
| Constructor and Description |
|---|
TradingOffice(IPlayer player,
ICity city,
int value) |
| Modifier and Type | Method and 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.
|
int |
getPropertyTax()
Retrieve the amount of property taxes per week
|
ISteward |
getSteward()
Gets the value of the property steward.
|
int |
getValue()
Retrieve the value of the building
|
void |
handleWeeklyUpdates(PeriodicalTimeWeekUpdate event) |
boolean |
hasWeapons()
check if there are any weapons in storage
|
private void |
init() |
private void |
initWares()
Init the amount of wares available in the city
This method is protected so it can be overriden by subclasses for testing
|
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.
This method is thread save.
|
void |
setSteward(ISteward steward)
Sets the value of the property steward.
|
javafx.beans.property.ObjectProperty<ISteward> |
stewardProperty()
Property holding the steward.
|
javafx.beans.binding.BooleanBinding |
storageManagerPresentBinding()
Binding indicating the presence of a steward.
|
addNewWare, containsWare, getOccupiedSpace, getWare, move, occupiedSpaceProperty, setOccupiedSpace, storedAmountBindingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBalanceLastWeek, getCity, getCurrentWeek, getOccupiedSpace, getOfficeTrading, getStorage, getWare, getWeaponStorage, setOccupiedSpace, storedAmountBindingcapacityProperty in interface ITradingOfficestewardProperty in interface ITradingOffice@Autowired private BuildingFactory buildingFactory
@Autowired private PlayerInteractionFactory interactionFactory
@Autowired private PeriodicalTimeUpdateFactory updateFactory
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
private static final int MAX_CAPACITY
private final IPlayer owner
private final ICity city
private final int baseValue
private final IWeaponStorage weaponStorage
private IStorage storage
private javafx.beans.property.ObjectProperty<ISteward> steward
private IBalanceSheet balanceLastWeek
private IBalanceSheet currentWeek
@Autowired private IAutomatedTrading officeTrading
private javafx.beans.property.IntegerProperty capacity
private javafx.beans.binding.BooleanBinding storageManagerPresent
@PostConstruct private void init()
private void initWares()
public javafx.beans.property.IntegerProperty capacityProperty()
ITradingOfficecapacityProperty in interface ITradingOfficepublic boolean hasWeapons()
ITradingOfficehasWeapons in interface ITradingOfficepublic int move(IWeapon weapon, int amount)
move in interface ITradingOfficeprotected int computeAVGPrice(IWare ware, int amount)
computeAVGPrice in class WareHoldingware - for which the average price is to be computedamount - amount that is boughtpublic 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 ISteward getSteward()
getSteward in interface ITradingOfficepublic void setSteward(ISteward steward)
setSteward in interface ITradingOfficepublic javafx.beans.property.ObjectProperty<ISteward> stewardProperty()
ITradingOfficestewardProperty in interface ITradingOfficepublic int getPropertyTax()
IBuildinggetPropertyTax in interface IBuildingpublic void handleWeeklyUpdates(PeriodicalTimeWeekUpdate event)
public int move(IWare ware, int amount)
ITradingOfficemove in interface ITradingOfficepublic int getValue()
IBuildingpublic javafx.beans.binding.BooleanBinding storageManagerPresentBinding()
ITradingOfficestorageManagerPresentBinding in interface ITradingOfficeCopyright © 2011-2015 Sahits GmbH. All Rights Reserved.