package sudoku.structure;

/**
 * Les difficultés d'un Sudoku,
 * représente le nombre de cases à enlever, en proportion, à un Sudoku.
 * Par exemple, avec 0.1 de factor, on enlevera 10% des cases.
 */
public enum Difficulty {

	VeryEasy("Très facile", 0.1),
	Easy("Facile", 0.25),
	Medium("Moyen", 0.5),
	Hard("Difficile", 0.75),
	VeryHard("Impossible", 0.78);

	/**
	 * Le pourcentage de Cell à enlever.
	 */
	final double factor;
	/**
	 * Le nom de la difficulté.
	 */
	final String displayName;

	Difficulty(String displayName, double factor) {
		this.factor = factor;
		this.displayName = displayName;
	}

	private static final String[] difficultyNames;

	static {
		Difficulty[] diffs = Difficulty.values();
		difficultyNames = new String[diffs.length];
		for (int i = 0; i < diffs.length; i++) {
			difficultyNames[i] = diffs[i].getDisplayName();
		}
	}

	public String getDisplayName() {
		return displayName;
	}

	public double getFactor() {
		return factor;
	}

	public static String[] getDifficultyNames() {
		return difficultyNames;
	}

}
