Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Walker;
- import org.osbot.script.Script;
- public class Path {
- public PathTile[] tiles;
- private Script s;
- public int index;
- public int maxIndex;
- private boolean walking;
- private int random;
- public Path(Script scr, PathTile[] t, int r) {
- this.s = scr;
- this.tiles = t;
- this.index = 0;
- this.maxIndex = (t.length - 1);
- this.walking = false;
- this.random = r;
- }
- public void start() {
- this.randomize();
- this.walking = true;
- }
- public void reset() {
- this.index = 0;
- this.walking = false;
- }
- public void stop() throws InterruptedException {
- this.reset();
- this.s.setRunning(false);
- }
- public void asd() {
- }
- public boolean shouldStop() {
- if (this.index > this.maxIndex) {
- return true;
- }
- return false;
- }
- public boolean isWalking() {
- return this.walking;
- }
- public PathTile next() {
- PathTile rtn = this.tiles[this.index];
- this.index += 1;
- return rtn;
- }
- public boolean shouldNext() {
- PathTile x = this.testNext();
- if (x != null && this.s.canReach(x) && x.random) {
- return true;
- }
- return false;
- }
- private PathTile testNext() {
- if (!this.shouldStop()) {
- return this.tiles[this.index];
- } else {
- return null;
- }
- }
- public void randomize() {
- for (int x = 0; x < this.tiles.length; x++) {
- this.tiles[x] = this.tiles[x].randomize(this.s, this.random);
- }
- }
- public boolean isWalkable() {
- boolean isit = true;
- for (int x = 0; x < this.tiles.length; x++) {
- if (x != 0) {
- }
- }
- return isit;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement