Class Stats

java.lang.Object
mindustry.world.meta.Stats

public class Stats extends Object
Hold and organizes a list of block stats.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    Deprecated.
    does nothing, will be removed in v9
    float
    Production time period in ticks.
    boolean
    Whether to display stats with categories.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Stat stat, boolean value)
    Adds a single y/n boolean value.
    void
    add(Stat stat, float value)
    Adds a single float value with this stat and no unit.
    void
    add(Stat stat, float value, StatUnit unit)
    Adds a single float value with this stat, formatted to 2 decimal places.
    void
    add(Stat stat, String format, Object... args)
    Adds a single string value with this stat.
    void
    add(Stat stat, Item item)
    Adds an item value.
    void
    add(Stat stat, ItemStack item)
    Adds an item value.
    void
    add(Stat stat, Liquid liquid, float amount, boolean perSecond)
    Adds an item value.
    void
    add(Stat stat, Attribute attr)
     
    void
    add(Stat stat, Attribute attr, boolean floating)
     
    void
    add(Stat stat, Attribute attr, boolean floating, float scale, boolean startZero)
     
    void
    add(Stat stat, Attribute attr, boolean floating, float scale1, float scale2, arc.struct.Seq<ItemStack> outputs, float timePeriod, boolean startZero)
     
    void
    add(Stat stat, Attribute attr, float scale)
     
    void
    add(Stat stat, StatValue value)
    Adds a stat value.
    void
    addMultModifier(Stat stat, float value)
    Adds a multiplicative modifier stat value.
    void
    addPercent(Stat stat, float value)
    Adds an integer percent stat value.
    void
    addPercentModifier(Stat stat, float value)
    Adds an percent modifier stat value.
    void
    remove(Stat stat)
    Removes a stat, if it exists.
    void
    replace(Stat stat, StatValue value)
    Replaces a stat, removing the old value if it exists.
    void
    statInfo(arc.scene.ui.layout.Cell<?> cell, Stat stat)
     
    arc.struct.OrderedMap<StatCat,arc.struct.OrderedMap<Stat,arc.struct.Seq<StatValue>>>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • useCategories

      public boolean useCategories
      Whether to display stats with categories. If false, categories are completely ignored during display.
    • intialized

      @Deprecated public boolean intialized
      Deprecated.
      does nothing, will be removed in v9
    • timePeriod

      public float timePeriod
      Production time period in ticks. Used for crafters.
  • Constructor Details

    • Stats

      public Stats()
  • Method Details

    • add

      public void add(Stat stat, float value, StatUnit unit)
      Adds a single float value with this stat, formatted to 2 decimal places.
    • add

      public void add(Stat stat, float value)
      Adds a single float value with this stat and no unit.
    • addPercent

      public void addPercent(Stat stat, float value)
      Adds an integer percent stat value. Value is assumed to be in the 0-1 range.
    • addMultModifier

      public void addMultModifier(Stat stat, float value)
      Adds a multiplicative modifier stat value. Value is assumed to be in the 0-1 range.
    • addPercentModifier

      public void addPercentModifier(Stat stat, float value)
      Adds an percent modifier stat value. Value is assumed to be in the 0-1 range.
    • add

      public void add(Stat stat, boolean value)
      Adds a single y/n boolean value.
    • add

      public void add(Stat stat, Item item)
      Adds an item value.
    • add

      public void add(Stat stat, ItemStack item)
      Adds an item value.
    • add

      public void add(Stat stat, Liquid liquid, float amount, boolean perSecond)
      Adds an item value.
    • add

      public void add(Stat stat, Attribute attr)
    • add

      public void add(Stat stat, Attribute attr, float scale)
    • add

      public void add(Stat stat, Attribute attr, boolean floating)
    • add

      public void add(Stat stat, Attribute attr, boolean floating, float scale, boolean startZero)
    • add

      public void add(Stat stat, Attribute attr, boolean floating, float scale1, float scale2, @Nullable arc.struct.Seq<ItemStack> outputs, float timePeriod, boolean startZero)
    • add

      public void add(Stat stat, String format, Object... args)
      Adds a single string value with this stat.
    • replace

      public void replace(Stat stat, StatValue value)
      Replaces a stat, removing the old value if it exists.
    • add

      public void add(Stat stat, StatValue value)
      Adds a stat value.
    • remove

      public void remove(Stat stat)
      Removes a stat, if it exists.
    • toMap

      public arc.struct.OrderedMap<StatCat,arc.struct.OrderedMap<Stat,arc.struct.Seq<StatValue>>> toMap()
    • statInfo

      public void statInfo(arc.scene.ui.layout.Cell<?> cell, Stat stat)