public class BuyTradingOfficeTradeStep extends Object implements ch.sahits.game.openpatrician.model.product.ITradeStep
| Modifier and Type | Field and Description |
|---|---|
private ch.sahits.game.openpatrician.model.city.ICity |
city |
private ch.sahits.game.openpatrician.model.product.ComputablePriceV2 |
computablePrice |
private int |
maxBuyPrice |
private ch.sahits.game.openpatrician.model.building.ITradingOffice |
tradingOffice |
private ch.sahits.game.openpatrician.model.product.IWare |
ware |
| Constructor and Description |
|---|
BuyTradingOfficeTradeStep() |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
buyWare(int availableAmount,
ch.sahits.game.openpatrician.model.IPlayer player,
ch.sahits.game.openpatrician.model.ICompany company,
int affordableAmount)
Execute the transaction of buying the ware from the city and moving it in the trading office
|
boolean |
execute() |
private ch.sahits.game.openpatrician.model.city.ICity city
private ch.sahits.game.openpatrician.model.building.ITradingOffice tradingOffice
private ch.sahits.game.openpatrician.model.product.IWare ware
@Autowired private ch.sahits.game.openpatrician.model.product.ComputablePriceV2 computablePrice
private int maxBuyPrice
private boolean buyWare(int availableAmount,
ch.sahits.game.openpatrician.model.IPlayer player,
ch.sahits.game.openpatrician.model.ICompany company,
int affordableAmount)
availableAmount - amount available in the cityplayer - doing the transactioncompany - of the playeraffordableAmount - amount that should be boughtpublic boolean execute()
execute in interface ch.sahits.game.openpatrician.model.product.ITradeStepCopyright © 2011-2017 Sahits GmbH. All Rights Reserved.