proper game closing
This commit is contained in:
parent
30360c7bd4
commit
8dd697bb66
|
@ -155,6 +155,7 @@ public abstract class AiPlayer extends LocalPlayer implements Runnable {
|
||||||
while(i.hasNext()) {
|
while(i.hasNext()) {
|
||||||
Thread thread = i.next();
|
Thread thread = i.next();
|
||||||
try {
|
try {
|
||||||
|
thread.interrupt();
|
||||||
thread.join();
|
thread.join();
|
||||||
i.remove();
|
i.remove();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class MainFrame extends JFrame {
|
||||||
* @author Lucas Bronson, Peer Ole Wachtel, Luca Conte
|
* @author Lucas Bronson, Peer Ole Wachtel, Luca Conte
|
||||||
*/
|
*/
|
||||||
public void showPanelWin(String panelName, Player player){
|
public void showPanelWin(String panelName, Player player){
|
||||||
if(player != gameBoard.getP1()){
|
if(gameBoard == null || player != gameBoard.getP1()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ public class MainFrame extends JFrame {
|
||||||
* @author Lucas Bronson, Peer Ole Wachtel, Luca Conte
|
* @author Lucas Bronson, Peer Ole Wachtel, Luca Conte
|
||||||
*/
|
*/
|
||||||
public void showPanelLose(String panelName, Player player){
|
public void showPanelLose(String panelName, Player player){
|
||||||
if(player != gameBoard.getP1()){
|
if(gameBoard == null || player != gameBoard.getP1()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue