RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Chebyshev.java
1package com.osroyale.game.world.pathfinding.distance;
2
3import com.osroyale.game.world.position.Position;
4
29
30public final class Chebyshev implements Distance {
31
32 @Override
33 public int calculate(Position to, Position from) {
34 int dx = Math.abs(from.getX() - to.getX());
35 int dy = Math.abs(from.getX() - to.getY());
36 return dx >= dy ? dx : dy;
37 }
38}