Package mindustry.world.blocks.power
Class PowerGraph
java.lang.Object
mindustry.world.blocks.power.PowerGraph
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(mindustry.gen.Building build) voidaddGraph(PowerGraph graph) floatchargeBatteries(float excess) voidcheckAdd()voidclear()voiddistributePower(float needed, float produced, boolean charged) floatfloatintgetId()intgetID()floatfloatfloatfloatfloatfloatfloatfloatfloatfloatfloatbooleanvoidreflow(mindustry.gen.Building tile) voidremove(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.voidremoveList(mindustry.gen.Building build) Used for unit tests only.toString()voidtransferPower(float amount) voidupdate()floatuseBatteries(float needed)
-
Field Details
-
producers
public final arc.struct.Seq<mindustry.gen.Building> producers -
consumers
public final arc.struct.Seq<mindustry.gen.Building> consumers -
batteries
public final arc.struct.Seq<mindustry.gen.Building> batteries -
all
public final arc.struct.Seq<mindustry.gen.Building> 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. -
getId
public int getId() -
toString
-