Commit 8eb0d71f authored by Anna Maria Eilertsen's avatar Anna Maria Eilertsen
Browse files

helper method + docs

parent 3cce1188
......@@ -261,6 +261,13 @@ public abstract class MNKGame {
return r;
}
/**
* Debug helper method for printing games during iteration
*
* @param x
* @param y
* @return
*/
private String debugToString(int x, int y) {
System.out.println("x="+x+", y="+y);
String r = "";
......@@ -277,12 +284,29 @@ public abstract class MNKGame {
return r;
}
/**
* @return the color of the starting piece of this game
*/
public static Piece getStartColor() {
return Piece.BLACK;
}
/**
* @return the color whose turn it is to be placed on the board
*/
public Piece getCurrent() {
return currentPlayer;
}
/**
* @return true if the game has any possible moves, false otherwise
*/
public boolean hasPossibleMoves() {
for(Piece piece : grid) {
if(piece == Piece.NONE)
return true;
}
return false;
}
}
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