Class BaseBuyTradeStep
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.player.tradesteps.BaseBuyTradeStep
-
- All Implemented Interfaces:
ch.sahits.game.openpatrician.model.product.ITradeStep
- Direct Known Subclasses:
BuyTradeStep,CheckedBuyTradeStep
public abstract class BaseBuyTradeStep extends java.lang.Object implements ch.sahits.game.openpatrician.model.product.ITradeStepBase class providing common functionality.- Author:
- Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 17, 2017
-
-
Constructor Summary
Constructors Constructor Description BaseBuyTradeStep()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longtransferFromOfficeOrBuyFromCity(ch.sahits.game.openpatrician.model.IPlayer player, int maxAmount)Try transferring the required amount from storage if there is a store manager and the transfer is allowed.
-
-
-
Method Detail
-
transferFromOfficeOrBuyFromCity
protected long transferFromOfficeOrBuyFromCity(ch.sahits.game.openpatrician.model.IPlayer player, int maxAmount)Try transferring the required amount from storage if there is a store manager and the transfer is allowed. The rest is then bought from the city.- Parameters:
player- for which the transfer happensmaxAmount- maximum amount of wares that should be loaded onto the vessel.- Returns:
- cost of the wares.
-
-