cleanup-work #22

Merged
lgc merged 12 commits from cleanup-work into main 2024-12-22 23:06:00 +00:00
1 changed files with 17 additions and 0 deletions
Showing only changes of commit 65451d6912 - Show all commits

View File

@ -35,6 +35,7 @@ public abstract class AiPlayer extends LocalPlayer implements Runnable {
}
public void aiShoot() {
if (!this.myTurn) return;
this.enemy.receiveShoot(RandomPoint());
return;
}
@ -93,4 +94,20 @@ public abstract class AiPlayer extends LocalPlayer implements Runnable {
this.aiShoot();
}
@Override
public void destroy() {
super.destroy();
Iterator<Thread> i = this.shootThreads.iterator();
while(i.hasNext()) {
Thread thread = i.next();
try {
thread.join();
i.remove();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}