1package com.runehive.game.world.pathfinding.distance;
3import com.runehive.game.world.position.Position;
17 int deltaX = Math.abs(from.
getX() - to.
getX());
18 int deltaY = Math.abs(from.
getY() - to.
getY());
19 return deltaX + deltaY;
The Manhattan Distance is the distance between two points measured along axes at right angles.
int calculate(Position to, Position from)
Calculates the heuristic value of the defined two positions.
Represents a single tile on the game world.
int getY()
Gets the absolute y coordinate.
int getX()
Gets the absolute x coordinate.
An interface to calculate the distance between two nodes in a Position.