forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
package lila.pref | ||
|
||
sealed abstract class PrefCateg(val slug: String) | ||
enum PrefCateg(val slug: String): | ||
|
||
object PrefCateg: | ||
|
||
case object Display extends PrefCateg("display") | ||
case object ChessClock extends PrefCateg("chess-clock") | ||
case object GameBehavior extends PrefCateg("game-behavior") | ||
case object Privacy extends PrefCateg("privacy") | ||
case object Notification extends PrefCateg("notification") | ||
case Display extends PrefCateg("display") | ||
case ChessClock extends PrefCateg("chess-clock") | ||
case GameBehavior extends PrefCateg("game-behavior") | ||
case Privacy extends PrefCateg("privacy") | ||
|
||
val all: List[PrefCateg] = List(Display, ChessClock, GameBehavior, Privacy, Notification) | ||
object PrefCateg: | ||
|
||
def apply(slug: String) = all.find(_.slug == slug) | ||
def apply(slug: String) = values.find(_.slug == slug) |