Class AutomatedTrading
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.building.impl.AutomatedTrading
-
- All Implemented Interfaces:
IAutomatedTrading
public class AutomatedTrading extends java.lang.Object implements IAutomatedTrading
-
-
Constructor Summary
Constructors Constructor Description AutomatedTrading()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.IntegerPropertyamountProperty(IWare ware)Get to the amount property of the tradeable ware.intgetAmount(IWare ware)Retrieve the minimal amount of the ware that should be hold in the storage.intgetPrice(IWare ware)Retrieve the price up to which the ware is bought or the minimal price for which it is sold.booleanisMovableToShip(IWare ware)Check if this ware can be moved onto ships with automated trading routesjavafx.beans.property.BooleanPropertymovableToShipProperty(IWare ware)Get the movable to ship flag.javafx.beans.property.IntegerPropertypriceProperty(IWare ware)Get the price property of the tradable ware.voidsetMovableToShip(IWare ware, boolean isMovable)Set the movable flagvoidsetTradingType(IWare ware, ETradeType tt)Set the Trayding type.javafx.beans.property.ObjectProperty<ETradeType>tradingTypeProperty(IWare ware)Retrieve the trading type of the ware.voidupdateAmount(IWare ware, int difference)Update the amount of warevoidupdatePrice(IWare ware, int difference)Update the price of the ware
-
-
-
Method Detail
-
getAmount
public int getAmount(IWare ware)
Description copied from interface:IAutomatedTradingRetrieve the minimal amount of the ware that should be hold in the storage.- Specified by:
getAmountin interfaceIAutomatedTrading- Parameters:
ware- to be hold- Returns:
- amount of that ware
-
amountProperty
public javafx.beans.property.IntegerProperty amountProperty(IWare ware)
Description copied from interface:IAutomatedTradingGet to the amount property of the tradeable ware.- Specified by:
amountPropertyin interfaceIAutomatedTrading- Parameters:
ware- for which to retrieve the amount- Returns:
- max amount property that should be stored
-
getPrice
public int getPrice(IWare ware)
Description copied from interface:IAutomatedTradingRetrieve the price up to which the ware is bought or the minimal price for which it is sold.- Specified by:
getPricein interfaceIAutomatedTrading- Parameters:
ware- to be bought or sold- Returns:
- price
-
priceProperty
public javafx.beans.property.IntegerProperty priceProperty(IWare ware)
Description copied from interface:IAutomatedTradingGet the price property of the tradable ware.- Specified by:
pricePropertyin interfaceIAutomatedTrading- Parameters:
ware- for which to retrieve the price- Returns:
- max price property
-
tradingTypeProperty
public javafx.beans.property.ObjectProperty<ETradeType> tradingTypeProperty(IWare ware)
Description copied from interface:IAutomatedTradingRetrieve the trading type of the ware. There are only three types applicable: NONE, OFFICE_CITY and CITY_OFFICE- Specified by:
tradingTypePropertyin interfaceIAutomatedTrading- Parameters:
ware- that should be checked- Returns:
- trading type of the ware.
-
isMovableToShip
public boolean isMovableToShip(IWare ware)
Description copied from interface:IAutomatedTradingCheck if this ware can be moved onto ships with automated trading routes- Specified by:
isMovableToShipin interfaceIAutomatedTrading- Parameters:
ware- that should be checked- Returns:
- true if the ware can be moved to a ship
-
movableToShipProperty
public javafx.beans.property.BooleanProperty movableToShipProperty(IWare ware)
Description copied from interface:IAutomatedTradingGet the movable to ship flag.- Specified by:
movableToShipPropertyin interfaceIAutomatedTrading- Parameters:
ware- for which to retrieve the movable flag- Returns:
- boolean property indicating if the ware is movable to a ship
-
updateAmount
public void updateAmount(IWare ware, int difference)
Description copied from interface:IAutomatedTradingUpdate the amount of ware- Specified by:
updateAmountin interfaceIAutomatedTrading- Parameters:
ware- to be updateddifference- in the amount
-
updatePrice
public void updatePrice(IWare ware, int difference)
Description copied from interface:IAutomatedTradingUpdate the price of the ware- Specified by:
updatePricein interfaceIAutomatedTrading- Parameters:
ware- to be updateddifference- in the price
-
setTradingType
public void setTradingType(IWare ware, ETradeType tt)
Description copied from interface:IAutomatedTradingSet the Trayding type. Only allowed types are NONE, OFFICE_CITY and CITY_OFFICE- Specified by:
setTradingTypein interfaceIAutomatedTrading- Parameters:
ware- to be updatedtt- trade type to set
-
setMovableToShip
public void setMovableToShip(IWare ware, boolean isMovable)
Description copied from interface:IAutomatedTradingSet the movable flag- Specified by:
setMovableToShipin interfaceIAutomatedTrading- Parameters:
ware- to be updatedisMovable- flag if the ware is movable to a ship
-
-