use of org.powerbot.bot.rt4.client.CollisionMap in project powerbot by powerbot.
the class LocalPath method getGraph.
static Graph getGraph(final ClientContext ctx) {
final Client client = ctx.client();
if (client == null) {
return null;
}
final int floor = client.getFloor();
final CollisionMap[] maps = client.getCollisionMaps();
final CollisionMap map;
if (maps == null || floor < 0 || floor >= maps.length || (map = maps[floor]) == null) {
return null;
}
final int[][] arr = map.getFlags();
final double[][] costs = getCosts(ctx, arr.length, arr.length);
return arr != null ? new Graph(arr, costs, map.getOffsetX(), map.getOffsetY()) : null;
}
Aggregations