added language.outputGameOverText() at line 53 Game.java
changed Method switchPlayer() and checkForTie() to private at line 71 and line 138 Game.java
This commit is contained in:
parent
acb204f551
commit
5c86d218cb
|
@ -50,6 +50,7 @@ public class Game {
|
||||||
|
|
||||||
if(checkForWin()) {
|
if(checkForWin()) {
|
||||||
language.outputWinnerText(playerPlaying);
|
language.outputWinnerText(playerPlaying);
|
||||||
|
language.outputGameOverText();
|
||||||
gameFinished = true;
|
gameFinished = true;
|
||||||
} else if (checkForTie()) {
|
} else if (checkForTie()) {
|
||||||
language.outputTieText();
|
language.outputTieText();
|
||||||
|
@ -67,7 +68,7 @@ public class Game {
|
||||||
* Methode placeField aufgerufen.
|
* Methode placeField aufgerufen.
|
||||||
* Der Spieler wird automatisch gewechselt.
|
* Der Spieler wird automatisch gewechselt.
|
||||||
*/
|
*/
|
||||||
public void switchPlayer() {
|
private void switchPlayer() {
|
||||||
if (playerPlaying == 1) {
|
if (playerPlaying == 1) {
|
||||||
playerPlaying = player2;
|
playerPlaying = player2;
|
||||||
} else {
|
} else {
|
||||||
|
@ -134,7 +135,7 @@ public class Game {
|
||||||
(gamefield.getField(field1) >= 1));
|
(gamefield.getField(field1) >= 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkForTie() {
|
private boolean checkForTie() {
|
||||||
return gamefield.countSetFields() == 9;
|
return gamefield.countSetFields() == 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue