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

import java.awt.image.BufferedImage;
import java.util.List;

import com.devinhartzell.chess.board.Board;
import com.devinhartzell.chess.board.Coordinate;

public abstract class ChessPiece {
	
	/*
	 * For type:
	 * p - pawn
	 * r - rook
	 * n - knight
	 * b - bishop
	 * q - queen
	 * k - king
	 * 0 - null
	 */
	public char type;
	
	/*
	 * true = white
	 * false = black
	 */
	public boolean color;
	public boolean isNull = false;
	public int x, y;
	public BufferedImage image;	
	
	// K = x, V = y
	public abstract List<Coordinate> getPossibleMoves();
	
	public abstract boolean isNull();
	
	public boolean getColor()
	{
		return color;
	}
	
	public char getType()
	{
		return type;
	}

	public void move(int new_x, int new_y)
	{
		
		int old_x = this.x;
		int old_y = this.y;
		
		Board.getBoardArray()[old_x][old_y].setPiece(new NullPiece(this.x, this.y));
		Board.getBoardArray()[old_x][old_y].setSelected(false);
		Board.getBoardArray()[new_x][new_y].setPiece(this);
		System.out.println(Board.getBoardArray()[new_x][new_y].getPiece().toString());
		
		
		this.x = new_x;
		this.y = new_y;
		//System.out.println(Board.getBoardArray()[x][y].toString());
		/*
		Board.getBoardArray()[this.x][this.y].setPiece(new NullPiece(this.x, this.y));
		Board.getBoardArray()[this.x][this.y].repaint();
		this.x = x;
		this.y = y;
		Board.getBoardArray()[x][y].setPiece(this);
		Board.getBoardArray()[x][y].repaint();
		*/
	}
	
	public BufferedImage getImage()
	{
		return image;
	}
	
	public void kill()
	{
		this.x = 0;
		this.y = 0;
	}<commit_msg>Remove the old highlighted squares after the piece is done moving<commit_after>package com.devinhartzell.chess.pieces;

import java.awt.image.BufferedImage;
import java.util.List;

import com.devinhartzell.chess.board.Board;
import com.devinhartzell.chess.board.Coordinate;

public abstract class ChessPiece {
	
	/*
	 * For type:
	 * p - pawn
	 * r - rook
	 * n - knight
	 * b - bishop
	 * q - queen
	 * k - king
	 * 0 - null
	 */
	public char type;
	
	/*
	 * true = white
	 * false = black
	 */
	public boolean color;
	public boolean isNull = false;
	public int x, y;
	public BufferedImage image;	
	
	// K = x, V = y
	public abstract List<Coordinate> getPossibleMoves();
	
	public abstract boolean isNull();
	
	public boolean getColor()
	{
		return color;
	}
	
	public char getType()
	{
		return type;
	}

	public void move(int new_x, int new_y)
	{
		
		int old_x = this.x;
		int old_y = this.y;
		
		for (Coordinate s : Board.getBoardArray()[old_x][old_y].getPiece().getPossibleMoves())
			Board.getBoardArray()[s.getX()][s.getY()].setHighlighted(false);
		
		Board.getBoardArray()[old_x][old_y].setPiece(new NullPiece(this.x, this.y));
		Board.getBoardArray()[old_x][old_y].setSelected(false);
		Board.getBoardArray()[new_x][new_y].setPiece(this);
		System.out.println(Board.getBoardArray()[new_x][new_y].getPiece().toString());
		
		this.x = new_x;
		this.y = new_y;
	}
	
	public BufferedImage getImage()
	{
		return image;
	}
	
	public void kill()
	{
		
		this.x = 0;
		this.y = 0;
	}
{'fraction_non_alphanumeric': 0.1473922902494331, 'fraction_numerical': 0.001943634596695821, 'mean_word_length': 3.4051355206847362, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3220542', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1140, 'n_words': 240}