Class PowerGraph

java.lang.Object
mindustry.world.blocks.power.PowerGraph

public class PowerGraph extends Object
  • Field Details

    • producers

      public final Seq<mindustry.gen.Building> producers
    • consumers

      public final Seq<mindustry.gen.Building> consumers
    • batteries

      public final Seq<mindustry.gen.Building> batteries
    • all

      public final 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

      public void addGraph(PowerGraph graph)
    • 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

      public String toString()
      Overrides:
      toString in class Object