package mitzi;

public class AnalysisResult {

	private int score;

	private boolean is_stalemate;

	private boolean needs_deeper;

	public AnalysisResult(int score, boolean is_stalemate, boolean needs_deeper) {
		this.score = score;
		this.is_stalemate = is_stalemate;
		this.needs_deeper = needs_deeper;
	}

	/**
	 * The boards score in centipawns.
	 * 
	 * @return
	 */
	public int getScore() {
		return score;
	}

	/**
	 * Check if the board is a stalemate position. I. e. no moves are possible
	 * but there is no check.
	 * 
	 * @return true iff stalemate
	 */
	public boolean isStalemate() {
		return is_stalemate;
	}

	/**
	 * Check if the evaluation method considers this board to be in an unstable
	 * state and recommends a deeper evalutation.
	 * 
	 * @return true iff further evaluation is advised
	 */
	public boolean needsDeeper() {
		return needs_deeper;
	}
}

@@ -16,16 +16,22 @@
 %0Apublic 
+final 
 class An
@@ -55,16 +55,22 @@
 private 
+final 
 int scor
@@ -74,32 +74,38 @@
 core;%0A%0A%09private 
+final 
 boolean is_stale
@@ -120,16 +120,22 @@
 private 
+final 
 boolean 
@@ -890,11 +890,648 @@
 eper;%0A%09%7D
+%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09final int prime = 31;%0A%09%09int result = 1;%0A%09%09result = prime * result + (is_stalemate ? 1231 : 1237);%0A%09%09result = prime * result + (needs_deeper ? 1231 : 1237);%0A%09%09result = prime * result + score;%0A%09%09return result;%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(Object obj) %7B%0A%09%09if (this == obj) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%09if (obj == null) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09if (getClass() != obj.getClass()) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09AnalysisResult other = (AnalysisResult) obj;%0A%09%09if (is_stalemate != other.is_stalemate%0A%09%09%09%09%7C%7C needs_deeper != other.needs_deeper %7C%7C score != other.score) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09return true;%0A%09%7D
 %0A%7D%0A

implement hashCode and equals