Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BotThread extends Thread {
- Bot bot;
- AStar pathFinder;
- Player targetPlayer;
- public List<boolean[]> plan;
- public BotThread(Bot bot) {
- this.bot = bot;
- this.plan = new ArrayList<>();
- pathFinder = new AStar(bot, bot.getLevelHandler());
- }
- public void run() {
- while (true) {
- System.out.println("THREAD RUNNING");
- targetPlayer = bot.targetPlayer;
- plan = pathFinder.optimise(targetPlayer);
- }
- }
- public boolean[] getNextAction() {
- return plan.remove(0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement