1package com.runehive.game.world.pathfinding.path;
3import com.runehive.game.world.Interactable;
4import com.runehive.game.world.entity.mob.Mob;
5import com.runehive.game.world.position.Position;
6import com.runehive.util.Utility;
21 return new Path(
null);
50 int xSignum = Integer.signum(dx);
51 int ySignum = Integer.signum(dy);
53 int nextX = start.
getX();
54 int nextY = start.
getY();
63 }
else if (nextX != end.
getX()) {
64 int pointSlope = (nextX + xSignum - start.
getX()) * dy / dx + start.
getY();
66 if (Math.abs(pointSlope - currentY) > 1) {
81 if (!projectile && !
traversable(current, next, size)) {
85 if (nextX == end.
getX() && nextY == end.
getY()) {
An algorithm used to find a path between two Positions.
boolean projectileCheck(Position current, Position going)
Returns whether or not a Position shooting projectile to another Position would lead to is traversabl...
boolean traversable(Position current, int size, Direction... directions)
Returns whether or not a Position walking one step in any of the specified Directions would lead to i...
Represents a single path in the path finding system.
Represents a PathFinder which is meant to be used to check projectiles passage in a straight line.
boolean check(Position start, Position end, int size, boolean projectile)
Determines if the projectile can reach it's destination.
static boolean checkProjectile(Interactable source, Interactable target)
Path find(Mob source, Position end, int targetWidth, int targetLength)
Finds a valid path from the origin Position to the target one.
static final SimplePathChecker SIMPLE_PATH_CHECKER
static boolean checkLine(Interactable source, Position target)
static boolean checkLine(Interactable source, Interactable target)
Represents a single tile on the game world.
int getHeight()
Gets the height coordinate, or height.
int getY()
Gets the absolute y coordinate.
int getX()
Gets the absolute x coordinate.
Handles miscellaneous methods.
static Position findBestInside(Interactable source, Interactable target)
An object implementing Interactable has uses.