refactor : Difficulty
Some checks failed
Linux arm64 / Build (push) Failing after 30s

This commit is contained in:
Melvyn
2025-02-02 16:07:29 +01:00
parent a8439df736
commit c6a32b8d07

View File

@@ -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;
}