public ArrayList<Piece> getPieces(PieceColor color) {
    ArrayList<Piece> pieces = new ArrayList<Piece>();
    
    for(Piece[] row : this.pieces) {
      for(Piece p : row) {
        if(p != null && p.getColor() == color) {
          pieces.add(p);
        }
      }
    }
    
    return pieces;
  }