|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.openpatrician.model.impl.WareHolding
ch.sahits.game.openpatrician.model.building.TradingOffice
class TradingOffice
Implementation of the trading office
| Field Summary | |
|---|---|
private int |
baseValue
Value of the building (building costs |
private ICity |
city
Reference to the city the trading office is located in |
private IBalanceSheet |
currentWeek
|
private IBalanceSheet |
lastWeek
|
private static int |
MAX_CAPACITY
Maximal capacity of the trading office in barrels |
private IPlayer |
player
Reference to the player |
private IStorage |
storage
|
private IWeaponStorage |
weapons
Weapons storage |
| Constructor Summary | |
|---|---|
TradingOffice(IPlayer player,
ICity city,
int value)
|
|
| Method Summary | |
|---|---|
protected int |
computeAVGPrice(IWare ware,
int amount)
Compute the average price for ware that is to be purchased in the specified amount. |
IBalanceSheet |
getBalanceLastWeek()
Retrieve the balance sheet for last completed week. |
int |
getCapacity()
Retrieve the storage capacity of the trading office and all other storages in the same city |
IBalanceSheet |
getCurrentWeek()
Retrieve the balance sheet for the current week |
IAutomatedTrading |
getOfficeTrading()
Get the trading object of the office |
IPlayer |
getOwner()
Retrieve the owner of the trading office |
int |
getPropertyTax()
Retrieve the amount of property taxes per week |
ISteward |
getSteward()
Retrieve the steward of the trading office (manager). |
IStorage |
getStorage()
Retrieve an overview over the storage |
int |
getStored()
Retrieve the total amount of the stored goods |
int |
getValue()
Retrieve the value of the building |
IWeaponStorage |
getWeaponStorage()
Retrieve the weapon storage for this trading office |
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. This method is thread save. |
void |
notify(DateObject date)
The time defined as period has passed and it is now date |
| Methods inherited from class ch.sahits.game.openpatrician.model.impl.WareHolding |
|---|
addNewWare, containsWare, getWare, move |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ch.sahits.game.openpatrician.model.building.ITradingOffice |
|---|
getWare |
| Field Detail |
|---|
private static final int MAX_CAPACITY
private final IPlayer player
private final ICity city
private final int baseValue
private final IWeaponStorage weapons
private final IStorage storage
private IBalanceSheet lastWeek
private IBalanceSheet currentWeek
| Constructor Detail |
|---|
public TradingOffice(IPlayer player,
ICity city,
int value)
| Method Detail |
|---|
public IPlayer getOwner()
IBuilding
getOwner in interface IBuildingpublic int getCapacity()
ITradingOffice
getCapacity in interface ITradingOfficepublic int getStored()
ITradingOffice
getStored in interface ITradingOfficepublic boolean hasWeapons()
ITradingOffice
hasWeapons in interface ITradingOffice
public int move(IWeapon weapon,
int amount)
move in interface ITradingOffice
protected int computeAVGPrice(IWare ware,
int amount)
computeAVGPrice in class WareHoldingware - for which the average price is to be computedamount - amount that is bought
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 IBalanceSheet getBalanceLastWeek()
ITradingOffice
getBalanceLastWeek in interface ITradingOfficepublic IBalanceSheet getCurrentWeek()
ITradingOffice
getCurrentWeek in interface ITradingOfficepublic ISteward getSteward()
ITradingOffice
getSteward in interface ITradingOfficepublic int getPropertyTax()
IBuilding
getPropertyTax in interface IBuildingpublic IAutomatedTrading getOfficeTrading()
ITradingOffice
getOfficeTrading in interface ITradingOfficepublic void notify(DateObject date)
IPeriodicalUpdatedate
notify in interface IPeriodicalUpdatedate - current date time
public int move(IWare ware,
int amount)
ITradingOffice
move in interface ITradingOfficepublic int getValue()
IBuilding
getValue in interface IBuildingpublic IWeaponStorage getWeaponStorage()
ITradingOffice
getWeaponStorage in interface ITradingOfficepublic IStorage getStorage()
ITradingOffice
getStorage in interface ITradingOffice
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||