Skip to content

Commit

Permalink
added generateFrontier() method. TODO: generateJumpFrontier() and gen…
Browse files Browse the repository at this point in the history
…erateMoveFrontier().
  • Loading branch information
Aaron committed Apr 20, 2016
1 parent 753b2b0 commit 1b3d63e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/model/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ public boolean equals(Board other) {
return true;
}

/**
* Generates the frontier.
* @param color The color of pieces to generate the frontier for.
* @return A list of possible "next moves" in the form of boards.
*/
public ArrayList<Board> generateFrontier(Color color) {
ArrayList<Board> from_jumps = generateJumpFrontier(color);
if(from_jumps.isEmpty()) {
return generateMoveFrontier(color);
}
return from_jumps;
}

/**
* Print the current board representation
*/
Expand Down

0 comments on commit 1b3d63e

Please sign in to comment.