Package net.sf.freecol.common.model
Interface BaseProduction
-
- All Known Implementing Classes:
BuildingType,TileType
public interface BaseProductionThe BaseProduction interface eliminates duplicate code inBuildingTypeandTileTypeas thegetBaseProduction(ProductionType, GoodsType, UnitType)method originally was identical methods in seperate classes
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<ProductionType>getAvailableProductionTypes(boolean unattended)At the interface level, this code is here simply to let thegetBaseProduction(ProductionType, GoodsType, UnitType)method know to reference the subclass's method.default intgetBaseProduction(ProductionType productionType, GoodsType goodsType, UnitType unitType)Get the base production of a given goods type for an optional unit type.
-
-
-
Method Detail
-
getBaseProduction
default int getBaseProduction(ProductionType productionType, GoodsType goodsType, UnitType unitType)
Get the base production of a given goods type for an optional unit type.- Parameters:
productionType- An optionalProductionTypeto use, if null the best available one is used.goodsType- TheGoodsTypeto produce.unitType- An optionalUnitTypethat is to do the work, if null the unattended production is considered.- Returns:
- The amount of goods produced.
-
getAvailableProductionTypes
java.util.List<ProductionType> getAvailableProductionTypes(boolean unattended)
At the interface level, this code is here simply to let thegetBaseProduction(ProductionType, GoodsType, UnitType)method know to reference the subclass's method.- Parameters:
unattended- Whether the production is unattended.- Returns:
- A list of
ProductionTypes.
-
-