Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement