Class BuildPlan

java.lang.Object
mindustry.entities.units.BuildPlan
All Implemented Interfaces:
Position, QuadTree.QuadTreeObject

public class BuildPlan extends Object implements Position, QuadTree.QuadTreeObject
Class for storing build plans. Can be either a place or remove plan.
  • Field Details

    • x

      public int x
      Position and rotation of this plan.
    • y

      public int y
      Position and rotation of this plan.
    • rotation

      public int rotation
      Position and rotation of this plan.
    • block

      @Nullable public Block block
      Block being placed. If null, this is a breaking plan.
    • breaking

      public boolean breaking
      Whether this is a break plan.
    • config

      public Object config
      Config int. Not used unless hasConfig is true.
    • originalX

      public int originalX
      Original position, only used in schematics.
    • originalY

      public int originalY
      Original position, only used in schematics.
    • originalWidth

      public int originalWidth
      Original position, only used in schematics.
    • originalHeight

      public int originalHeight
      Original position, only used in schematics.
    • progress

      public float progress
      Last progress.
    • initialized

      public boolean initialized
      Whether construction has started for this plan.
    • stuck

      public boolean stuck
      Whether construction has started for this plan.
    • cachedValid

      public boolean cachedValid
      Whether construction has started for this plan.
    • worldContext

      public boolean worldContext
      If true, this plan is in the world. If false, it is being rendered in a schematic.
    • animScale

      public float animScale
      Visual scale. Used only for rendering.
  • Constructor Details

    • BuildPlan

      public BuildPlan(int x, int y, int rotation, Block block)
      This creates a build plan.
    • BuildPlan

      public BuildPlan(int x, int y, int rotation, Block block, Object config)
      This creates a build plan with a config.
    • BuildPlan

      public BuildPlan(int x, int y)
      This creates a remove plan.
    • BuildPlan

      public BuildPlan()
  • Method Details

    • placeable

      public boolean placeable(Team team)
    • isRotation

      public boolean isRotation(Team team)
    • samePos

      public boolean samePos(BuildPlan other)
    • pointConfig

      public static Object pointConfig(Block block, Object config, Cons<Point2> cons)
      Transforms the internal position of this config using the specified function, and return the result.
    • pointConfig

      public void pointConfig(Cons<Point2> cons)
      Transforms the internal position of this config using the specified function.
    • copy

      public BuildPlan copy()
    • original

      public BuildPlan original(int x, int y, int originalWidth, int originalHeight)
    • bounds

      public Rect bounds(Rect rect)
    • set

      public BuildPlan set(int x, int y, int rotation, Block block)
    • drawx

      public float drawx()
    • drawy

      public float drawy()
    • tile

      @Nullable public Tile tile()
    • build

      @Nullable public mindustry.gen.Building build()
    • hitbox

      public void hitbox(Rect out)
      Description copied from interface: QuadTree.QuadTreeObject
      Fills the out parameter with this element's rough bounding box. This should never be smaller than the actual object, but may be larger.
      Specified by:
      hitbox in interface QuadTree.QuadTreeObject
    • getX

      public float getX()
      Specified by:
      getX in interface Position
    • getY

      public float getY()
      Specified by:
      getY in interface Position
    • toString

      public String toString()
      Overrides:
      toString in class Object