<commit_before>package com.devinhartzell.chess.board;

import javax.swing.JOptionPane;

import com.devinhartzell.chess.ChessGame;
import com.devinhartzell.chess.gui.BoardPanel;
import com.devinhartzell.chess.gui.ChessGameWindow;
import com.devinhartzell.chess.pieces.Bishop;
import com.devinhartzell.chess.pieces.ChessPiece;
import com.devinhartzell.chess.pieces.King;
import com.devinhartzell.chess.pieces.Knight;
import com.devinhartzell.chess.pieces.NullPiece;
import com.devinhartzell.chess.pieces.Pawn;
import com.devinhartzell.chess.pieces.Queen;
import com.devinhartzell.chess.pieces.Rook;

/*
 * Wrapper for the boardArray squares
 */
public class Board {
	
	private Square[][] boardArray = new Square[9][9];
	
	private King whiteKing;
	private King blackKing;

	private BoardPanel boardPanel;
	
	private boolean check_w = false;
	private boolean check_b = false;
	
	private boolean mainBoard = false;
	
	/*
	 * Tracks who has the next move
	 * False = white
	 * True = black
	 */
	public  boolean currentMove = false;
	
	public Board() {
		this(false);
	}
	
	public Board(Board base) {
		this(false);
		for (int i = 1; i<=8; i++) {
			for (int j = 1; j<=8; j++) {
				if (base.getBoardArray()[i][j].getPiece() instanceof Pawn) 
					new Pawn(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Knight)
					new Knight(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Bishop)
					new Bishop(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Rook)
					new Rook(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Queen)
					new Queen(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof King)
					if (!base.getBoardArray()[i][j].getPiece().getColor())
						whiteKing = new King(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
					else
						blackKing = new King(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
			}
		}
	}
	
	public Board(boolean mainBoard) {
		
		this.mainBoard = mainBoard;
		

		
		for (int i = 1; i <= 8; i++) {
			for (int j = 1; j <= 8; j++) {
				Square sq = new Square(i, j, this);
				getBoardArray()[i][j] = sq;
			}
		}
		
		if (mainBoard) {
			ChessGame.setMainBoard(this);
			boardPanel = new BoardPanel();
			boardPanel.setLocation(6, 6);
			for (int i = 1; i <= 8; i++) {
				for (int j = 1; j<= 8; j++) {
					getBoardArray()[i][j].setPanel(boardPanel.getPanelArray()[i][j]);
				}
			}
		
			for (int i = 1; i<=8; i++) {
				new Pawn(i, 2, true, this);
				new Pawn(i, 7, false, this);
			}
			/*
			new Rook(1, 1, true, this);
			new Rook(8, 1, true, this);
			new Rook(1, 8, false, this);
			new Rook(8, 8, false, this);
			
			
			new Queen(4, 8, false, this);
			new Queen(4, 1, true, this);
			
			new Knight(2, 1, true, this);
			new Knight(7, 1, true, this);
			new Knight(2, 8, false, this);
			new Knight(7, 8, false, this);
			
			new Bishop(3, 1, true, this);
			new Bishop(6, 1, true, this);
			new Bishop(3, 8, false, this);
			new Bishop(6, 8, false, this);
			*/
			
			whiteKing = new King(5, 8, false, this);
			blackKing = new King(5, 1, true, this);
			
		}
	}
	
	public void duplicate(Board board) {<commit_msg>Re-add the pieces<commit_after>package com.devinhartzell.chess.board;

import javax.swing.JOptionPane;

import com.devinhartzell.chess.ChessGame;
import com.devinhartzell.chess.gui.BoardPanel;
import com.devinhartzell.chess.gui.ChessGameWindow;
import com.devinhartzell.chess.pieces.Bishop;
import com.devinhartzell.chess.pieces.ChessPiece;
import com.devinhartzell.chess.pieces.King;
import com.devinhartzell.chess.pieces.Knight;
import com.devinhartzell.chess.pieces.NullPiece;
import com.devinhartzell.chess.pieces.Pawn;
import com.devinhartzell.chess.pieces.Queen;
import com.devinhartzell.chess.pieces.Rook;

/*
 * Wrapper for the boardArray squares
 */
public class Board {
	
	private Square[][] boardArray = new Square[9][9];
	
	private King whiteKing;
	private King blackKing;

	private BoardPanel boardPanel;
	
	private boolean check_w = false;
	private boolean check_b = false;
	
	private boolean mainBoard = false;
	
	/*
	 * Tracks who has the next move
	 * False = white
	 * True = black
	 */
	public  boolean currentMove = false;
	
	public Board() {
		this(false);
	}
	
	public Board(Board base) {
		this(false);
		for (int i = 1; i<=8; i++) {
			for (int j = 1; j<=8; j++) {
				if (base.getBoardArray()[i][j].getPiece() instanceof Pawn) 
					new Pawn(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Knight)
					new Knight(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Bishop)
					new Bishop(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Rook)
					new Rook(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof Queen)
					new Queen(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
				else if (base.getBoardArray()[i][j].getPiece() instanceof King)
					if (!base.getBoardArray()[i][j].getPiece().getColor())
						whiteKing = new King(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
					else
						blackKing = new King(i,j, base.getBoardArray()[i][j].getPiece().getColor(), this);
			}
		}
	}
	
	public Board(boolean mainBoard) {
		
		this.mainBoard = mainBoard;
		

		
		for (int i = 1; i <= 8; i++) {
			for (int j = 1; j <= 8; j++) {
				Square sq = new Square(i, j, this);
				getBoardArray()[i][j] = sq;
			}
		}
		
		if (mainBoard) {
			ChessGame.setMainBoard(this);
			boardPanel = new BoardPanel();
			boardPanel.setLocation(6, 6);
			for (int i = 1; i <= 8; i++) {
				for (int j = 1; j<= 8; j++) {
					getBoardArray()[i][j].setPanel(boardPanel.getPanelArray()[i][j]);
				}
			}
		
			for (int i = 1; i<=8; i++) {
				new Pawn(i, 2, true, this);
				new Pawn(i, 7, false, this);
			}
			
			new Rook(1, 1, true, this);
			new Rook(8, 1, true, this);
			new Rook(1, 8, false, this);
			new Rook(8, 8, false, this);
			
			
			new Queen(4, 8, false, this);
			new Queen(4, 1, true, this);
			
			new Knight(2, 1, true, this);
			new Knight(7, 1, true, this);
			new Knight(2, 8, false, this);
			new Knight(7, 8, false, this);
			
			new Bishop(3, 1, true, this);
			new Bishop(6, 1, true, this);
			new Bishop(3, 8, false, this);
			new Bishop(6, 8, false, this);
			
			
			whiteKing = new King(5, 8, false, this);
			blackKing = new King(5, 1, true, this);
			
		}
	}
	
	public void duplicate(Board board) {
{'fraction_non_alphanumeric': 0.16849236091092534, 'fraction_numerical': 0.014989910637071202, 'mean_word_length': 3.5892857142857144, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6192412', 'n_tokens_mistral': 3049, 'n_tokens_neox': 2544, 'n_words': 616}