Search in sources :

Example 1 with CollisionMap

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;
}
Also used : Client(org.powerbot.bot.rt4.client.Client) CollisionMap(org.powerbot.bot.rt4.client.CollisionMap)

Aggregations

Client (org.powerbot.bot.rt4.client.Client)1 CollisionMap (org.powerbot.bot.rt4.client.CollisionMap)1