Skip to content

Commit

Permalink
Fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
john committed Apr 20, 2016
2 parents 791a755 + 8150181 commit 8540176
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/model/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ public Board() {
representation = new Piece[BOARD_SIZE][BOARD_SIZE];
movesSinceCapture = 0;
init();

}

/**
* Copy constructor.
* @param other
*/
public Board(Board other) {
this.representation = new Piece[BOARD_SIZE][BOARD_SIZE];
Piece[][] other_representation = other.getRepresentation();
for (int i = 0; i < other_representation.length; ++i) {
for (int j = 0; j < other_representation[0].length; ++j) {
this.representation[i][j] = other_representation[i][j];
}
}
movesSinceCapture = other.getMovesSinceCapture();
}

public boolean isValidSquare(Location location) {
Expand Down Expand Up @@ -59,6 +75,25 @@ public boolean equals(Board other) {
return true;
}

public ArrayList<Board> generateMoveFrontier(Color color) {
ArrayList<Board> frontier = new ArrayList<Board>();


}

/**
* 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 Expand Up @@ -104,6 +139,10 @@ public boolean isOccupied(Location location) {

public Piece[][] getRepresentation() {
return this.representation;
}

public int getMovesSinceCapture() {
return this.movesSinceCapture;
}
}

0 comments on commit 8540176

Please sign in to comment.