Interface IAutomatedTrading
-
- All Known Implementing Classes:
AutomatedTrading
public interface IAutomatedTrading
Interface defining the automated trading done by the steward between the city and the office. When wares are to be bough the amount indicates up to which amount in storage the ware should be bought. If the ware is sold, the amount indicates the lower limit of ware that should be retained in the storage.- Author:
- Andi Hotz, (c) Sahits GmbH, 2012 Created on Jul 22, 2012
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javafx.beans.property.IntegerProperty
amountProperty(IWare ware)
Get to the amount property of the tradeable ware.int
getAmount(IWare ware)
Retrieve the minimal amount of the ware that should be hold in the storage.int
getPrice(IWare ware)
Retrieve the price up to which the ware is bought or the minimal price for which it is sold.boolean
isMovableToShip(IWare ware)
Check if this ware can be moved onto ships with automated trading routesjavafx.beans.property.BooleanProperty
movableToShipProperty(IWare ware)
Get the movable to ship flag.javafx.beans.property.IntegerProperty
priceProperty(IWare ware)
Get the price property of the tradable ware.void
setMovableToShip(IWare ware, boolean isMovable)
Set the movable flagvoid
setTradingType(IWare ware, ETradeType tt)
Set the Trayding type.javafx.beans.property.ObjectProperty<ETradeType>
tradingTypeProperty(IWare ware)
Retrieve the trading type of the ware.void
updateAmount(IWare ware, int difference)
Update the amount of warevoid
updatePrice(IWare ware, int difference)
Update the price of the ware
-
-
-
Method Detail
-
getAmount
int getAmount(IWare ware)
Retrieve the minimal amount of the ware that should be hold in the storage.- Parameters:
ware
- to be hold- Returns:
- amount of that ware
-
getPrice
int getPrice(IWare ware)
Retrieve the price up to which the ware is bought or the minimal price for which it is sold.- Parameters:
ware
- to be bought or sold- Returns:
- price
-
tradingTypeProperty
javafx.beans.property.ObjectProperty<ETradeType> tradingTypeProperty(IWare ware)
Retrieve the trading type of the ware. There are only three types applicable: NONE, OFFICE_CITY and CITY_OFFICE- Parameters:
ware
- that should be checked- Returns:
- trading type of the ware.
-
isMovableToShip
boolean isMovableToShip(IWare ware)
Check if this ware can be moved onto ships with automated trading routes- Parameters:
ware
- that should be checked- Returns:
- true if the ware can be moved to a ship
-
updateAmount
void updateAmount(IWare ware, int difference)
Update the amount of ware- Parameters:
ware
- to be updateddifference
- in the amount
-
updatePrice
void updatePrice(IWare ware, int difference)
Update the price of the ware- Parameters:
ware
- to be updateddifference
- in the price
-
setTradingType
void setTradingType(IWare ware, ETradeType tt)
Set the Trayding type. Only allowed types are NONE, OFFICE_CITY and CITY_OFFICE- Parameters:
ware
- to be updatedtt
- trade type to set
-
setMovableToShip
void setMovableToShip(IWare ware, boolean isMovable)
Set the movable flag- Parameters:
ware
- to be updatedisMovable
- flag if the ware is movable to a ship
-
amountProperty
javafx.beans.property.IntegerProperty amountProperty(IWare ware)
Get to the amount property of the tradeable ware.- Parameters:
ware
- for which to retrieve the amount- Returns:
- max amount property that should be stored
-
priceProperty
javafx.beans.property.IntegerProperty priceProperty(IWare ware)
Get the price property of the tradable ware.- Parameters:
ware
- for which to retrieve the price- Returns:
- max price property
-
movableToShipProperty
javafx.beans.property.BooleanProperty movableToShipProperty(IWare ware)
Get the movable to ship flag.- Parameters:
ware
- for which to retrieve the movable flag- Returns:
- boolean property indicating if the ware is movable to a ship
-
-