daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class BotThread extends Thread {
  2.  
  3.   Bot bot;
  4.   AStar pathFinder;
  5.   Player targetPlayer;
  6.   public List<boolean[]> plan;
  7.  
  8.   public BotThread(Bot bot) {
  9.     this.bot = bot;
  10.     this.plan = new ArrayList<>();
  11.     pathFinder = new AStar(bot, bot.getLevelHandler());
  12.   }
  13.  
  14.   public void run() {
  15.     while (true) {
  16.       System.out.println("THREAD RUNNING");
  17.       targetPlayer = bot.targetPlayer;
  18.       plan = pathFinder.optimise(targetPlayer);
  19.     }
  20.   }
  21.  
  22.   public boolean[] getNextAction() {
  23.     return plan.remove(0);
  24.   }
  25.  
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top