47 lines
1.1 KiB
Java
47 lines
1.1 KiB
Java
package io.reisub.dreambot.cagility;
|
|
|
|
import org.dreambot.api.methods.interactive.GameObjects;
|
|
import org.dreambot.api.methods.interactive.Players;
|
|
import org.dreambot.api.methods.map.Area;
|
|
import org.dreambot.api.methods.map.Tile;
|
|
import org.dreambot.api.methods.walking.path.impl.LocalPath;
|
|
import org.dreambot.api.wrappers.interactive.GameObject;
|
|
|
|
public class Obstacle {
|
|
private final int id;
|
|
private final Area area;
|
|
private final LocalPath<Tile> path;
|
|
private Obstacle next;
|
|
|
|
public Obstacle(int id, Area area, Tile... walkingTiles) {
|
|
this.id = id;
|
|
this.area = area;
|
|
path = new LocalPath<>();
|
|
path.addAll(walkingTiles);
|
|
}
|
|
|
|
public int getID() {
|
|
return this.id;
|
|
}
|
|
|
|
public GameObject getGameObject() {
|
|
return GameObjects.closest(getID());
|
|
}
|
|
|
|
public Obstacle getNext() {
|
|
return this.next;
|
|
}
|
|
|
|
public void setNext(Obstacle next) {
|
|
this.next = next;
|
|
}
|
|
|
|
public boolean isPlayerInArea() {
|
|
return area.contains(Players.localPlayer());
|
|
}
|
|
|
|
public LocalPath<Tile> getPath() {
|
|
return path;
|
|
}
|
|
}
|