Package mindustry.entities.units
Class BuildPlan
java.lang.Object
mindustry.entities.units.BuildPlan
- All Implemented Interfaces:
arc.math.geom.Position
,arc.math.geom.QuadTree.QuadTreeObject
public class BuildPlan
extends Object
implements arc.math.geom.Position, arc.math.geom.QuadTree.QuadTreeObject
Class for storing build plans. Can be either a place or remove plan.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat
Visual scale.Block being placed.boolean
Whether this is a break plan.boolean
Whether construction has started for this plan.Config int.boolean
Whether construction has started for this plan.int
Original position, only used in schematics.int
Original position, only used in schematics.int
Original position, only used in schematics.int
Original position, only used in schematics.float
Last progress.int
Position and rotation of this plan.boolean
Whether construction has started for this plan.boolean
If true, this plan is in the world.int
Position and rotation of this plan.int
Position and rotation of this plan. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarc.math.geom.Rect
bounds
(arc.math.geom.Rect rect) mindustry.gen.Building
build()
copy()
float
drawx()
float
drawy()
float
getX()
float
getY()
void
hitbox
(arc.math.geom.Rect out) boolean
isDone()
boolean
isRotation
(Team team) original
(int x, int y, int originalWidth, int originalHeight) boolean
void
pointConfig
(arc.func.Cons<arc.math.geom.Point2> cons) Transforms the internal position of this config using the specified function.static Object
pointConfig
(Block block, Object config, arc.func.Cons<arc.math.geom.Point2> cons) Transforms the internal position of this config using the specified function, and return the result.boolean
tile()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface arc.math.geom.Position
angleTo, angleTo, dst, dst, dst2, dst2, within, within
-
Field Details
-
x
public int xPosition and rotation of this plan. -
y
public int yPosition and rotation of this plan. -
rotation
public int rotationPosition and rotation of this plan. -
block
Block being placed. If null, this is a breaking plan. -
breaking
public boolean breakingWhether this is a break plan. -
config
Config int. Not used unless hasConfig is true. -
originalX
public int originalXOriginal position, only used in schematics. -
originalY
public int originalYOriginal position, only used in schematics. -
originalWidth
public int originalWidthOriginal position, only used in schematics. -
originalHeight
public int originalHeightOriginal position, only used in schematics. -
progress
public float progressLast progress. -
initialized
public boolean initializedWhether construction has started for this plan. -
stuck
public boolean stuckWhether construction has started for this plan. -
cachedValid
public boolean cachedValidWhether construction has started for this plan. -
worldContext
public boolean worldContextIf true, this plan is in the world. If false, it is being rendered in a schematic. -
animScale
public float animScaleVisual scale. Used only for rendering.
-
-
Constructor Details
-
BuildPlan
This creates a build plan. -
BuildPlan
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
-
isRotation
-
samePos
-
pointConfig
public static Object pointConfig(Block block, Object config, arc.func.Cons<arc.math.geom.Point2> cons) Transforms the internal position of this config using the specified function, and return the result. -
pointConfig
public void pointConfig(arc.func.Cons<arc.math.geom.Point2> cons) Transforms the internal position of this config using the specified function. -
copy
-
original
-
bounds
public arc.math.geom.Rect bounds(arc.math.geom.Rect rect) -
set
-
drawx
public float drawx() -
drawy
public float drawy() -
isDone
public boolean isDone() -
tile
-
build
@Nullable public mindustry.gen.Building build() -
hitbox
public void hitbox(arc.math.geom.Rect out) - Specified by:
hitbox
in interfacearc.math.geom.QuadTree.QuadTreeObject
-
getX
public float getX()- Specified by:
getX
in interfacearc.math.geom.Position
-
getY
public float getY()- Specified by:
getY
in interfacearc.math.geom.Position
-
toString
-