1package com.runehive.game.world.pathfinding.distance;
3import com.runehive.game.world.position.Position;
13 int dx = Math.abs(from.
getX() - to.
getX());
14 int dy = Math.abs(from.
getX() - to.
getY());
15 return dx >= dy ? dx : dy;
int calculate(Position to, Position from)
Calculates the heuristic value of the defined two positions.
The Chebyshev heuristic, ideal for a system that allows for 8-directional movement.
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.