Merge branch 'master' of https://git.informatik.uni-leipzig.de/mt85zybu/VierGewinnt
This commit is contained in:
commit
b5dc4406fa
|
@ -3,7 +3,7 @@ package game;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import player.Player;
|
import player.Player;
|
||||||
import player.Player2;
|
import player.MaurizioAI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a game of Connect Four.
|
* Represents a game of Connect Four.
|
||||||
|
@ -168,14 +168,14 @@ public class Game {
|
||||||
* @return the state of the game, -1 = still undecided , 0 = draw, 1 = Player 1 wins, ...
|
* @return the state of the game, -1 = still undecided , 0 = draw, 1 = Player 1 wins, ...
|
||||||
*/
|
*/
|
||||||
private int checkState(boolean output) {
|
private int checkState(boolean output) {
|
||||||
if(Player2.checkWin(this.board, p1.getID())){
|
if(MaurizioAI.checkWin(this.board, p1.getID())){
|
||||||
this.gameOn = false;
|
this.gameOn = false;
|
||||||
if(output){
|
if(output){
|
||||||
System.out.println(p1.getP().getName() + " wins!");
|
System.out.println(p1.getP().getName() + " wins!");
|
||||||
}
|
}
|
||||||
return p1.getID(); // player 1 wins
|
return p1.getID(); // player 1 wins
|
||||||
}
|
}
|
||||||
if(Player2.checkWin(this.board, p2.getID())){
|
if(MaurizioAI.checkWin(this.board, p2.getID())){
|
||||||
this.gameOn = false;
|
this.gameOn = false;
|
||||||
if(output){
|
if(output){
|
||||||
System.out.println(p2.getP().getName() + " wins!");
|
System.out.println(p2.getP().getName() + " wins!");
|
||||||
|
|
Loading…
Reference in a new issue