Package net.sf.freecol.common.model
Interface BaseProduction
-
- All Known Implementing Classes:
BuildingType
,TileType
public interface BaseProduction
The BaseProduction interface eliminates duplicate code inBuildingType
andTileType
as 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 int
getBaseProduction(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 optionalProductionType
to use, if null the best available one is used.goodsType
- TheGoodsType
to produce.unitType
- An optionalUnitType
that 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
ProductionType
s.
-
-