package mitzi;

import java.util.Map;

public final class UCIReporter {

	/**
	 * the engine should send these infos regularly
	 * 
	 * DEPTH: search depth in plies
	 * 
	 * NODES: number of nodes searched
	 * 
	 * NPS: number of nodes per second searched
	 * 
	 * SCORE_CP: the score from the engine's point of view in centipawns
	 */
	public static enum InfoType {
		DEPTH("depth"), NODES("nodes"), NPS("nps"), SCORE_CP("score cp");

		public String string;

		InfoType(String string) {
			this.string = string;
		}
	}

	private UCIReporter() {
	};

	/**
	 * Send debugging messages to the GUI.
	 * 
	 * @param string
	 *            the message to be displayed
	 */
	public static void sendInfoString(String string) {
		System.out.println("info string " + string);
	}

	/**
	 * Send information about search depth, number of nodes searched and number
	 * of nodes searched per second to the GUI.
	 * 
	 * @param type
	 *            one of UCIReporter.InfoType
	 * @param string
	 *            the integer value to be sent
	 */
	public static void sendInfoInt(InfoType type, int value) {
		System.out.println("info " + type.string + " " + value);
	}

	/**
	 * The Principal variation (PV) is a sequence of moves that programs
	 * consider best and therefore expect to be played. Also all infos belonging
	 * to the PV should be sent together.
	 * 
	 * NOTE: will most likely be extended later
	 * 
	 * @param pv
	 * @param depth
	 * @param value
	 *            the board's value in centipawns. positive values are in favor
	 *            of white.
	 */
	public static void sendInfoPV(Map<Integer, IMove> pv, int depth, int value) {
		System.out.print("info value cp " + value + " depth " + depth + " pv");
		for (int i = 0; pv.get(i) != null; i++)
			System.out.print(" " + pv.get(i));
		System.out.println();
	}
}

@@ -253,83 +253,8 @@
 hed%0A
-%09 * %0A%09 * SCORE_CP: the score from the engine's point of view in centipawns%0A
 %09 */
@@ -333,30 +333,8 @@
 ps%22)
-, SCORE_CP(%22score cp%22)
 ;%0A%0A%09
@@ -1337,20 +1337,20 @@
  @param 
-valu
+scor
 e%0A%09 *   
@@ -1370,20 +1370,20 @@
 board's 
-valu
+scor
 e in cen
@@ -1485,27 +1485,17 @@
 oPV(
-Map%3CInteger, IMove%3E
+Variation
  pv,
@@ -1506,28 +1506,28 @@
  depth, int 
-valu
+scor
 e) %7B%0A%09%09Syste
@@ -1541,19 +1541,21 @@
 rint
+ln
 (%22info 
-valu
+scor
 e cp
@@ -1559,20 +1559,20 @@
  cp %22 + 
-valu
+scor
 e + %22 de
@@ -1588,120 +1588,26 @@
 epth
- + %22 pv%22);%0A%09%09for (int i = 0; pv.get(i) != null; i++)%0A%09%09%09System.out.print(%22 %22 + pv.get(i));%0A%09%09System.out.println(
+%0A%09%09%09%09+ %22 pv %22 + pv
 );%0A%09

revert changes and modify to accept Variation objects