Commit ca4cf17d authored by Anna Maria Eilertsen's avatar Anna Maria Eilertsen
Browse files

extract method to appropriate class

parent f8686640
......@@ -21,9 +21,6 @@ import inf101.v20.lab4.grid.Grid;
import inf101.v20.sem2.mnkgames.MNKGame;
import inf101.v20.sem2.mnkgames.MNKGame.Piece;
import inf101.v20.sem2.mnkgames.gameplay.TwoPlayerGame;
import inf101.v20.sem2.mnkgames.player.HumanPlayer;
import inf101.v20.sem2.mnkgames.player.AI.AIPlayer;
import inf101.v20.sem2.mnkgames.player.AI.SimpleAIPlayer;
/**
*
......@@ -180,7 +177,7 @@ s * Initializes a JFrame in which we place the game
}
private boolean filled() {
return game.getPieceAt(x, y) != Piece.NONE;
return game.hasPieceAt(x, y);
}
public void click() {
......
......@@ -151,4 +151,8 @@ public class TwoPlayerGame {
public TwoPlayerGame getNewGame(MNKGame game) {
return new TwoPlayerGame(game, p1, p2);
}
public boolean hasPieceAt(int x, int y) {
return game.getPieceAt(x, y) != Piece.NONE;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment