Initial commit: Lumen Android puzzle notebook v1.7
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.lumen.daily;
|
||||
|
||||
public enum Difficulty {
|
||||
EASY("Easy", "Short deductions. A gentle place to begin."),
|
||||
MEDIUM("Medium", "Link deductions across rows and columns."),
|
||||
HARD("Hard", "Follow longer chains to uncover the pattern.");
|
||||
|
||||
public final String label;
|
||||
public final String description;
|
||||
|
||||
Difficulty(String label, String description) {
|
||||
this.label = label;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static Difficulty fromRounds(int rounds) {
|
||||
if (rounds <= 2) return EASY;
|
||||
if (rounds <= 4) return MEDIUM;
|
||||
return HARD;
|
||||
}
|
||||
|
||||
public static Difficulty fromStored(String value) {
|
||||
try {
|
||||
return valueOf(value);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return EASY;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user