Bug fix: neue Runde
This commit is contained in:
parent
c938905f13
commit
83904c8ab3
|
|
@ -15,20 +15,20 @@ public class TicTacToe {
|
||||||
// Laden der Spielstände
|
// Laden der Spielstände
|
||||||
Speicher.spielstaendeEinlesen();
|
Speicher.spielstaendeEinlesen();
|
||||||
|
|
||||||
f = new Fenster();
|
|
||||||
f.macheSichtbar(true);
|
|
||||||
|
|
||||||
// Spiel starten
|
// Spiel starten
|
||||||
try {
|
try {
|
||||||
boolean nochEinSpiel = true;
|
boolean nochEinSpiel = true;
|
||||||
while (nochEinSpiel) {
|
while (nochEinSpiel) {
|
||||||
|
|
||||||
f.newSpielfeld();
|
f = null;
|
||||||
|
f = new Fenster();
|
||||||
nochEinSpiel = new Spiel(f).spielen();
|
nochEinSpiel = new Spiel(f).spielen();
|
||||||
|
|
||||||
// aufräumen
|
// aufräumen
|
||||||
|
f.setVisible(false);
|
||||||
Gewinner.setSpieler(null);
|
Gewinner.setSpieler(null);
|
||||||
Zug.setZugNummer(0);
|
Zug.setZugNummer(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
System.err.println("Da ist was schief gelaufen!");
|
System.err.println("Da ist was schief gelaufen!");
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ package gfn.marc.gui;
|
||||||
import gfn.marc.Feld;
|
import gfn.marc.Feld;
|
||||||
import gfn.marc.Speicher;
|
import gfn.marc.Speicher;
|
||||||
import gfn.marc.Spielfeld;
|
import gfn.marc.Spielfeld;
|
||||||
import gfn.marc.Zug;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
@ -68,10 +67,9 @@ public class Fenster extends JFrame implements ActionListener {
|
||||||
});
|
});
|
||||||
this.setLocationRelativeTo(null);
|
this.setLocationRelativeTo(null);
|
||||||
this.setResizable(false);
|
this.setResizable(false);
|
||||||
|
|
||||||
|
|
||||||
this.getContentPane().add(this.myPanel);
|
this.getContentPane().add(this.myPanel);
|
||||||
this.spielfeld = new Spielfeld(this);
|
this.spielfeld = new Spielfeld(this);
|
||||||
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hinzufuegen(Component c) {
|
public void hinzufuegen(Component c) {
|
||||||
|
|
@ -87,14 +85,6 @@ public class Fenster extends JFrame implements ActionListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void newSpielfeld() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void macheSichtbar(boolean sichtbar) {
|
|
||||||
this.setVisible(sichtbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setzeTitel(String titel) {
|
public void setzeTitel(String titel) {
|
||||||
this.setTitle(titel);
|
this.setTitle(titel);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue