Package net.sf.freecol.common.model
Interface Consumer
-
- All Known Implementing Classes:
Building,BuildQueue,ServerBuilding,ServerUnit,Unit,UnitType
public interface ConsumerObjects implementing the Consumer interface consume Goods. Examples include units that eat food, buildings that convert Goods into other Goods, or buildings that store Goods.
-
-
Field Summary
Fields Modifier and Type Field Description static intBUILDING_PRIORITYDefault consumption priority for buildings.static intCOLONY_PRIORITYThe consumption priority of the colony build queue.static java.util.Comparator<Consumer>COMPARATORCompare consumers by descending priority.static intPOPULATION_PRIORITYDefault consumption priority for the Colony when producing new colonists (from food).static intUNIT_PRIORITYDefault consumption priority for units.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<AbstractGoods>getConsumedGoods()Returns a list of GoodsTypes this Consumer consumes.java.util.stream.Stream<Modifier>getConsumptionModifiers(java.lang.String id)Get the modifier set with the given id.intgetPriority()The priority of this Consumer.
-
-
-
Field Detail
-
COMPARATOR
static final java.util.Comparator<Consumer> COMPARATOR
Compare consumers by descending priority.
-
POPULATION_PRIORITY
static final int POPULATION_PRIORITY
Default consumption priority for the Colony when producing new colonists (from food).- See Also:
- Constant Field Values
-
COLONY_PRIORITY
static final int COLONY_PRIORITY
The consumption priority of the colony build queue.- See Also:
- Constant Field Values
-
BUILDING_PRIORITY
static final int BUILDING_PRIORITY
Default consumption priority for buildings. Individual building types may have different priorities.- See Also:
- Constant Field Values
-
UNIT_PRIORITY
static final int UNIT_PRIORITY
Default consumption priority for units. Individual unit types may have different priorities. Slave units, or converts, or petty criminals, for example, might have a lower priority.- See Also:
- Constant Field Values
-
-
Method Detail
-
getConsumedGoods
java.util.List<AbstractGoods> getConsumedGoods()
Returns a list of GoodsTypes this Consumer consumes.- Returns:
- a
Listvalue
-
getPriority
int getPriority()
The priority of this Consumer. The higher the priority, the earlier will the Consumer be allowed to consume the goods it requires.- Returns:
- an
intvalue
-
getConsumptionModifiers
java.util.stream.Stream<Modifier> getConsumptionModifiers(java.lang.String id)
Get the modifier set with the given id. The modifier most relevant to consumers is "consumeOnlySurplusProduction", which implies that the consumer does not consume stored goods (used by the country and stables).- Parameters:
id- The object identifier.- Returns:
- The stream of
Modifiers found.
-
-