// Path: src/main/java/com/fluxchess/pulse/model/Color.java
// public final class Color {
// 
// 	public static final int WHITE = 0;
// 	public static final int BLACK = 1;
// 
// 	public static final int NOCOLOR = 2;
// 
// 	public static final int[] values = {
// 			WHITE, BLACK
// 	};
// 
// 	private Color() {
// 	}
// 
// 	public static int opposite(int color) {
// 		switch (color) {
// 			case WHITE:
// 				return BLACK;
// 			case BLACK:
// 				return WHITE;
// 			default:
// 				throw new IllegalArgumentException();
// 		}
// 	}
// }
// 
// Path: src/main/java/com/fluxchess/pulse/MoveList.java
// static class MoveEntry {
// 
// 	int move = NOMOVE;
// 	int value = NOVALUE;
// }


import com.fluxchess.jcpi.models.GenericBoard;
import com.fluxchess.jcpi.models.GenericMove;
import com.fluxchess.pulse.model.Color;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import static com.fluxchess.pulse.MoveList.MoveEntry;
		for (int i = 0; i < MAX_DEPTH; i++) {
			moveGenerators[i] = new MoveGenerator();
		}
	}

	private static P p(String fen, E... perftEntries) {
		return new P(fen, perftEntries);
	}

	private static E e(int depth, long nodes) {
		return new E(depth, nodes);
	}

	private long miniMax(int depth, Position position, int ply) {
		if (depth <= 0) {
			return 1;
		}

		long totalNodes = 0;

		boolean isCheck = position.isCheck();
		MoveList<MoveEntry> moves = moveGenerators[ply].getMoves(position, depth, isCheck);

		for (int i = 0; i < moves.size; i++) {
			int move = moves.entries[i].move;

			position.makeMove(move);
			if (!position.isCheck(Color.opposite(position.activeColor))) {
				totalNodes += miniMax(depth - 1, position, ply + 1);
			}
// Path: src/main/java/com/fluxchess/pulse/model/Color.java
// public final class Color {
// 
// 	public static final int WHITE = 0;
// 	public static final int BLACK = 1;
// 
// 	public static final int NOCOLOR = 2;
// 
// 	public static final int[] values = {
// 			WHITE, BLACK
// 	};
// 
// 	private Color() {
// 	}
// 
// 	public static int opposite(int color) {
// 		switch (color) {
// 			case WHITE:
// 				return BLACK;
// 			case BLACK:
// 				return WHITE;
// 			default:
// 				throw new IllegalArgumentException();
// 		}
// 	}
// }
// 
// Path: src/main/java/com/fluxchess/pulse/MoveList.java
// static class MoveEntry {
// 
// 	int move = NOMOVE;
// 	int value = NOVALUE;
// }


// Path: src/test/java/com/fluxchess/pulse/MoveGeneratorTest.java
import com.fluxchess.jcpi.models.GenericBoard;
import com.fluxchess.jcpi.models.GenericMove;
import com.fluxchess.pulse.model.Color;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import static com.fluxchess.pulse.MoveList.MoveEntry;

		for (int i = 0; i < MAX_DEPTH; i++) {
			moveGenerators[i] = new MoveGenerator();
		}
	}

	private static P p(String fen, E... perftEntries) {
		return new P(fen, perftEntries);
	}

	private static E e(int depth, long nodes) {
		return new E(depth, nodes);
	}

	private long miniMax(int depth, Position position, int ply) {
		if (depth <= 0) {
			return 1;
		}

		long totalNodes = 0;

		boolean isCheck = position.isCheck();
		MoveList<MoveEntry> moves = moveGenerators[ply].getMoves(position, depth, isCheck);

		for (int i = 0; i < moves.size; i++) {
			int move = moves.entries[i].move;

			position.makeMove(move);
			if (!position.isCheck(Color.opposite(position.activeColor))) {
				totalNodes += miniMax(depth - 1, position, ply + 1);
			}
			position.undoMove(move);