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
Modifier and TypeFieldDescriptionboolean
True if the module can store power.float
The maximum power capacity in power units.float
The maximum amount of power which can be processed per tick.Fields inherited from class mindustry.world.consumers.Consume
booster, multiplier, optional, update
-
Constructor Summary
ModifierConstructorDescriptionprotected
ConsumePower
(float usage, float capacity, boolean buffered) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply extra filters to a block.void
float
efficiency
(mindustry.gen.Building build) boolean
ignore()
float
requestedPower
(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:Consume
Apply extra filters to a block. -
ignore
public boolean ignore() -
efficiency
public float efficiency(mindustry.gen.Building build) - Overrides:
efficiency
in 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.
-