Package mindustry.ai
Class ControlPathfinder
java.lang.Object
mindustry.ai.ControlPathfinder
- All Implemented Interfaces:
Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Pathfinder.PathCost
static final Pathfinder.PathCost
static final int
static final int
static final int
static final int
static final Pathfinder.PathCost
static final Pathfinder.PathCost
static final arc.struct.Seq<Pathfinder.PathCost>
static boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getPathPosition
(mindustry.gen.Unit unit, arc.math.geom.Vec2 destination, arc.math.geom.Vec2 out, boolean[] noResultFound) boolean
getPathPosition
(mindustry.gen.Unit unit, arc.math.geom.Vec2 destination, arc.math.geom.Vec2 mainDestination, arc.math.geom.Vec2 out, boolean[] noResultFound) static boolean
isNearObstacle
(mindustry.gen.Unit unit, int x1, int y1, int x2, int y2) static int
raycastFast
(int team, Pathfinder.PathCost type, int x1, int y1, int x2, int y2) static int
raycastFastAvoid
(int team, Pathfinder.PathCost type, int x1, int y1, int x2, int y2) void
run()
void
void
updateTile
(Tile tile)
-
Field Details
-
showDebug
public static boolean showDebug -
costGround
-
costHover
-
costLegs
-
costIdGround
public static final int costIdGround- See Also:
-
costIdHover
public static final int costIdHover- See Also:
-
costIdLegs
public static final int costIdLegs- See Also:
-
costTypes
-
-
Constructor Details
-
ControlPathfinder
public ControlPathfinder()
-
-
Method Details
-
updateTile
-
updateSingleTile
-
isNearObstacle
public static boolean isNearObstacle(mindustry.gen.Unit unit, int x1, int y1, int x2, int y2) -
getPathPosition
public boolean getPathPosition(mindustry.gen.Unit unit, arc.math.geom.Vec2 destination, arc.math.geom.Vec2 out, @Nullable boolean[] noResultFound) -
getPathPosition
public boolean getPathPosition(mindustry.gen.Unit unit, arc.math.geom.Vec2 destination, arc.math.geom.Vec2 mainDestination, arc.math.geom.Vec2 out, @Nullable boolean[] noResultFound) -
raycastFast
- Returns:
- 0 if nothing was hit, otherwise the packed coordinates. This is an internal function and will likely be moved - do not use!
-
raycastFastAvoid
public static int raycastFastAvoid(int team, Pathfinder.PathCost type, int x1, int y1, int x2, int y2) - Returns:
- 0 if nothing was hit, otherwise the packed coordinates. This is an internal function and will likely be moved - do not use!
-
run
public void run()
-