<commit_before>package mitzi;

import java.util.Locale;
import java.util.Set;

public class Move implements IMove {

	private int src;

	private int dest;

	private int promotion;

	/**
	 * Move constructor
	 * 
	 * @param src
	 *            Source
	 * @param dest
	 *            Destination
	 * @param promotion
	 *            Promotion (if no, then omit)
	 */
	public Move(int src, int dest, int promotion) {
		this.src = src;
		this.dest = dest;
		this.promotion = promotion;
	}

	public Move(int src, int dest) {
		this(src, dest, 0);
	}

	public Move(String notation) {
		String[] squares = new String[2];

		squares[0] = notation.substring(0, 2);
		squares[1] = notation.substring(2, 4);

		src = SquareHelper.fromString(squares[0]);
		dest = SquareHelper.fromString(squares[1]);

		if (notation.length() > 4) {
			String promo_string = notation.substring(4, 5).toLowerCase(
					Locale.ENGLISH);
			if (promo_string.equals("q")) {
				promotion = PieceHelper.QUEEN;
			} else if (promo_string.equals("r")) {
				promotion = PieceHelper.ROOK;
			} else if (promo_string.equals("n")) {
				promotion = PieceHelper.KNIGHT;
			} else if (promo_string.equals("b")) {
				promotion = PieceHelper.BISHOP;
			}
		} else {
			promotion = 0;
		}
	}

	@Override
	public int getFromSquare() {
		return src;
	}

	@Override
	public int getToSquare() {
		return dest;
	}

	@Override
	public int getPromotion() {
		return promotion;
	}

	@Override
	public String toString() {
		String promote_to;
		if (getPromotion() != 0) {
			promote_to = PieceHelper.toString(getPromotion());
		} else {
			promote_to = "";
		}
		return SquareHelper.toString(getFromSquare())
				+ SquareHelper.toString(getToSquare()) + promote_to;
	}

	/**
	 * 
	 * Checks if a move is in a given List of moves
	 * 
	 * @param moves List of moves
	 * @param move	the move to be searched
	 * @return true if move is in moves, else false
	 */
	public static Boolean MovesListIncludesMove(Set<Move> moves, Move move) {
		return moves.contains(move);

	}

	@Override
	public boolean equals(IMove move){
		if(move.getFromSquare() == src && move.getToSquare() == dest && move.getPromotion() == promotion)
			return true;
		return false;
	}
}<commit_msg>enumify<commit_after>package mitzi;

import java.util.Locale;
import java.util.Set;

public class Move implements IMove {

	private int src;

	private int dest;

	private Piece promotion;

	/**
	 * Move constructor
	 * 
	 * @param src
	 *            Source
	 * @param dest
	 *            Destination
	 * @param promotion
	 *            Promotion (if no, then omit)
	 */
	public Move(int src, int dest, Piece promotion) {
		this.src = src;
		this.dest = dest;
		this.promotion = promotion;
	}

	public Move(int src, int dest) {
		this(src, dest, Piece.EMPTY);
	}

	public Move(String notation) {
		String[] squares = new String[2];

		squares[0] = notation.substring(0, 2);
		squares[1] = notation.substring(2, 4);

		src = SquareHelper.fromString(squares[0]);
		dest = SquareHelper.fromString(squares[1]);

		if (notation.length() > 4) {
			String promo_string = notation.substring(4, 5).toLowerCase(
					Locale.ENGLISH);
			if (promo_string.equals("q")) {
				promotion = Piece.QUEEN;
			} else if (promo_string.equals("r")) {
				promotion = Piece.ROOK;
			} else if (promo_string.equals("n")) {
				promotion = Piece.KNIGHT;
			} else if (promo_string.equals("b")) {
				promotion = Piece.BISHOP;
			}
		} else {
			promotion = Piece.EMPTY;
		}
	}

	@Override
	public int getFromSquare() {
		return src;
	}

	@Override
	public int getToSquare() {
		return dest;
	}

	@Override
	public Piece getPromotion() {
		return promotion;
	}

	@Override
	public String toString() {
		String promote_to;
		if (getPromotion() != Piece.EMPTY) {
			promote_to = PieceHelper.toString(Side.WHITE, getPromotion());
		} else {
			promote_to = "";
		}
		return SquareHelper.toString(getFromSquare())
				+ SquareHelper.toString(getToSquare()) + promote_to;
	}

	/**
	 * 
	 * Checks if a move is in a given List of moves
	 * 
	 * @param moves
	 *            List of moves
	 * @param move
	 *            the move to be searched
	 * @return true if move is in moves, else false
	 */
	public static Boolean MovesListIncludesMove(Set<Move> moves, Move move) {
		return moves.contains(move);

	}

	@Override
	public boolean equals(IMove move) {
		if (move.getFromSquare() == src && move.getToSquare() == dest
				&& move.getPromotion() == promotion)
			return true;
		return false;
	}
}
{'fraction_non_alphanumeric': 0.12717925793473403, 'fraction_numerical': 0.006034868126955744, 'mean_word_length': 3.135859519408503, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1506208', 'n_tokens_mistral': 1721, 'n_tokens_neox': 1502, 'n_words': 390}