Package mindustry.world.consumers
Class ConsumePower
java.lang.Object
mindustry.world.consumers.Consume
mindustry.world.consumers.ConsumePower
- Direct Known Subclasses:
ConsumePowerCondition,ConsumePowerDynamic
Consumer class for blocks which consume power while being connected to a power graph.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanTrue if the module can store power.floatThe maximum power capacity in power units.floatThe maximum amount of power which can be processed per tick.Fields inherited from class mindustry.world.consumers.Consume
booster, multiplier, optional, update -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConsumePower(float usage, float capacity, boolean buffered) -
Method Summary
Modifier and TypeMethodDescriptionvoidApply extra filters to a block.voidfloatefficiency(mindustry.gen.Building build) booleanignore()floatrequestedPower(mindustry.gen.Building entity) Retrieves the amount of power which is requested for the given block and entity.
-
Field Details
-
usage
public float usageThe maximum amount of power which can be processed per tick. This might influence efficiency or load a buffer. -
capacity
public float capacityThe maximum power capacity in power units. -
buffered
public boolean bufferedTrue if the module can store power.
-
-
Constructor Details
-
ConsumePower
public ConsumePower(float usage, float capacity, boolean buffered) -
ConsumePower
protected ConsumePower()
-
-
Method Details
-
apply
Description copied from class:ConsumeApply extra filters to a block. -
ignore
public boolean ignore() -
efficiency
public float efficiency(mindustry.gen.Building build) - Overrides:
efficiencyin classConsume- Returns:
- [0, 1] efficiency multiplier based on input. Returns 0 if not valid in subclasses. Should return fraction if needs are partially met.
-
display
-
requestedPower
public float requestedPower(mindustry.gen.Building entity) Retrieves the amount of power which is requested for the given block and entity.- Parameters:
entity- The entity which contains the power module.- Returns:
- The amount of power which is requested per tick.
-