Package mindustry.world.blocks.power
Class PowerGraph
java.lang.Object
mindustry.world.blocks.power.PowerGraph
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(mindustry.gen.Building build) void
addGraph
(PowerGraph graph) float
chargeBatteries
(float excess) void
checkAdd()
void
clear()
void
distributePower
(float needed, float produced, boolean charged) float
float
int
getID()
float
float
float
float
float
float
float
float
float
float
float
boolean
void
reflow
(mindustry.gen.Building tile) void
remove
(mindustry.gen.Building tile) Note that this does not actually remove the building from the graph; it creates *new* graphs that contain the correct buildings.void
removeList
(mindustry.gen.Building build) Used for unit tests only.toString()
void
transferPower
(float amount) void
update()
float
useBatteries
(float needed)
-
Field Details
-
producers
-
consumers
-
batteries
-
all
-
-
Constructor Details
-
PowerGraph
public PowerGraph() -
PowerGraph
public PowerGraph(boolean noEntity)
-
-
Method Details
-
getID
public int getID() -
getLastScaledPowerIn
public float getLastScaledPowerIn() -
getLastScaledPowerOut
public float getLastScaledPowerOut() -
getLastCapacity
public float getLastCapacity() -
getPowerBalance
public float getPowerBalance() -
hasPowerBalanceSamples
public boolean hasPowerBalanceSamples() -
getLastPowerNeeded
public float getLastPowerNeeded() -
getLastPowerProduced
public float getLastPowerProduced() -
getLastPowerStored
public float getLastPowerStored() -
transferPower
public void transferPower(float amount) -
getSatisfaction
public float getSatisfaction() -
getPowerProduced
public float getPowerProduced() -
getPowerNeeded
public float getPowerNeeded() -
getBatteryStored
public float getBatteryStored() -
getBatteryCapacity
public float getBatteryCapacity() -
getTotalBatteryCapacity
public float getTotalBatteryCapacity() -
useBatteries
public float useBatteries(float needed) -
chargeBatteries
public float chargeBatteries(float excess) -
distributePower
public void distributePower(float needed, float produced, boolean charged) -
update
public void update() -
addGraph
-
add
public void add(mindustry.gen.Building build) -
checkAdd
public void checkAdd() -
clear
public void clear() -
reflow
public void reflow(mindustry.gen.Building tile) -
removeList
public void removeList(mindustry.gen.Building build) Used for unit tests only. -
remove
public void remove(mindustry.gen.Building tile) Note that this does not actually remove the building from the graph; it creates *new* graphs that contain the correct buildings. Doing this invalidates the graph. -
toString
-