Interface Payload

All Superinterfaces:
arc.math.geom.Position
All Known Implementing Classes:
BuildPayload, UnitPayload

public interface Payload extends arc.math.geom.Position
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
     
     
    default void
     
    void
    draws this payload at a position.
    void
    drawShadow(float alpha)
     
    default boolean
     
    default boolean
    fits(float s)
     
    default float
     
    default float
     
    arc.graphics.g2d.TextureRegion
     
    static <T extends Payload>
    T
    read(arc.util.io.Reads read)
     
    default void
     
     
    default float
     
    void
    set(float x, float y, float rotation)
    sets this payload's position on the map.
    float
     
    default void
    update(mindustry.gen.Unit unitHolder, mindustry.gen.Building buildingHolder)
    update this payload inside a container unit or building.
    void
    write(arc.util.io.Writes write)
    writes the payload for saving.
    static void
    write(Payload payload, arc.util.io.Writes write)
     
    float
    x()
     
    float
    y()
     

    Methods inherited from interface arc.math.geom.Position

    angleTo, angleTo, dst, dst, dst2, dst2, within, within
  • Field Details

  • Method Details

    • set

      void set(float x, float y, float rotation)
      sets this payload's position on the map.
    • draw

      void draw()
      draws this payload at a position.
    • drawShadow

      void drawShadow(float alpha)
    • size

      float size()
      Returns:
      hitbox size of the payload.
    • x

      float x()
    • y

      float y()
    • requirements

      ItemStack[] requirements()
      Returns:
      the items needed to make this payload; may be empty.
    • buildTime

      float buildTime()
      Returns:
      the time taken to build this payload.
    • update

      default void update(@Nullable mindustry.gen.Unit unitHolder, @Nullable mindustry.gen.Building buildingHolder)
      update this payload inside a container unit or building. either can be null.
    • dump

      default boolean dump()
      Returns:
      whether this payload was dumped.
    • fits

      default boolean fits(float s)
      Returns:
      whether this payload fits in a given size. 3 is the max for a standard 3x3 conveyor.
    • rotation

      default float rotation()
      Returns:
      rotation of this payload.
    • destroyed

      default void destroyed()
    • write

      void write(arc.util.io.Writes write)
      writes the payload for saving.
    • icon

      arc.graphics.g2d.TextureRegion icon()
      Returns:
      icon describing the contents.
    • content

      Returns:
      content describing this payload (block or unit)
    • getX

      default float getX()
      Specified by:
      getX in interface arc.math.geom.Position
    • getY

      default float getY()
      Specified by:
      getY in interface arc.math.geom.Position
    • remove

      default void remove()
    • write

      static void write(@Nullable Payload payload, arc.util.io.Writes write)
    • read

      @Nullable static <T extends Payload> T read(arc.util.io.Reads read)