This commit is contained in:
@@ -1,26 +1,32 @@
|
||||
package sudoku.structure;
|
||||
|
||||
//TODO: melvyn va passer par là
|
||||
/**
|
||||
* 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);
|
||||
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;
|
||||
|
||||
private Difficulty(String displayName, double factor) {
|
||||
Difficulty(String displayName, double factor) {
|
||||
this.factor = factor;
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public double getFactor() {
|
||||
return factor;
|
||||
}
|
||||
|
||||
private static final String[] difficultyNames;
|
||||
|
||||
static {
|
||||
@@ -31,6 +37,14 @@ public enum Difficulty {
|
||||
}
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public double getFactor() {
|
||||
return factor;
|
||||
}
|
||||
|
||||
public static String[] getDifficultyNames() {
|
||||
return difficultyNames;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user