Package mindustry.ai
Class ControlPathfinder
java.lang.Object
mindustry.ai.ControlPathfinder
- All Implemented Interfaces:
Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Pathfinder.PathCoststatic final Pathfinder.PathCoststatic final intstatic final intstatic final intstatic final intstatic final Pathfinder.PathCoststatic final Pathfinder.PathCoststatic final arc.struct.Seq<Pathfinder.PathCost>static boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetPathPosition(mindustry.gen.Unit unit, arc.math.geom.Vec2 destination, arc.math.geom.Vec2 out, boolean[] noResultFound) booleangetPathPosition(mindustry.gen.Unit unit, arc.math.geom.Vec2 destination, arc.math.geom.Vec2 mainDestination, arc.math.geom.Vec2 out, boolean[] noResultFound) static booleanisNearObstacle(mindustry.gen.Unit unit, int x1, int y1, int x2, int y2) static intraycastFast(int team, Pathfinder.PathCost type, int x1, int y1, int x2, int y2) static intraycastFastAvoid(int team, Pathfinder.PathCost type, int x1, int y1, int x2, int y2) voidrun()voidvoidupdateTile(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()
-