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
18 changed files
with
108 additions
and
134 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
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
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,19 +1,15 @@ | ||
package lila.push | ||
|
||
sealed abstract private class Stacking(val key: String, val message: String) | ||
private enum Stacking(val key: String, val message: String): | ||
|
||
private object Stacking: | ||
|
||
case object GameFinish extends Stacking("gameFinish", "$[notif_count] games are over") | ||
case object GameMove extends Stacking("gameMove", "It's your turn in $[notif_count] games") | ||
case object GameTakebackOffer | ||
extends Stacking("gameTakebackOffer", "Takeback offers in $[notif_count] games") | ||
case object GameDrawOffer extends Stacking("gameDrawOffer", "Draw offers in $[notif_count] games") | ||
case object PrivateMessage extends Stacking("privateMessage", "You have $[notif_count] new messages") | ||
case object ChallengeCreate extends Stacking("challengeCreate", "You have $[notif_count] new challenges") | ||
case object ChallengeAccept | ||
extends Stacking("challengeAccept", "$[notif_count] players accepted your challenges") | ||
case object TourSoon extends Stacking("tourSoon", "$[notif_count] tournaments are starting") | ||
case object ForumMention extends Stacking("forumMention", "You have been mentioned $[notif_count] times") | ||
case object StreamStart extends Stacking("streamStart", "$[notif_count] streamers streaming") | ||
case object InvitedStudy extends Stacking("invitedStudy", "You have $[notif_count] study invites") | ||
case GameFinish extends Stacking("gameFinish", "$[notif_count] games are over") | ||
case GameMove extends Stacking("gameMove", "It's your turn in $[notif_count] games") | ||
case GameTakebackOffer extends Stacking("gameTakebackOffer", "Takeback offers in $[notif_count] games") | ||
case GameDrawOffer extends Stacking("gameDrawOffer", "Draw offers in $[notif_count] games") | ||
case PrivateMessage extends Stacking("privateMessage", "You have $[notif_count] new messages") | ||
case ChallengeCreate extends Stacking("challengeCreate", "You have $[notif_count] new challenges") | ||
case ChallengeAccept extends Stacking("challengeAccept", "$[notif_count] players accepted your challenges") | ||
case TourSoon extends Stacking("tourSoon", "$[notif_count] tournaments are starting") | ||
case ForumMention extends Stacking("forumMention", "You have been mentioned $[notif_count] times") | ||
case StreamStart extends Stacking("streamStart", "$[notif_count] streamers streaming") | ||
case InvitedStudy extends Stacking("invitedStudy", "You have $[notif_count] study invites") |
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
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
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
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,23 +1,18 @@ | ||
package lila.puzzle | ||
|
||
sealed abstract class PuzzleTier(val key: String): | ||
|
||
enum PuzzleTier: | ||
def key = toString | ||
def stepDown = PuzzleTier stepDown this | ||
|
||
override def toString = key | ||
case top, good, all | ||
|
||
object PuzzleTier: | ||
|
||
case object Top extends PuzzleTier("top") | ||
case object Good extends PuzzleTier("good") | ||
case object All extends PuzzleTier("all") | ||
|
||
def stepDown(tier: PuzzleTier): Option[PuzzleTier] = | ||
if (tier == Top) Good.some | ||
else if (tier == Good) All.some | ||
if (tier == top) good.some | ||
else if (tier == good) all.some | ||
else none | ||
|
||
def from(tier: String) = | ||
if (tier == Top.key) Top | ||
else if (tier == Good.key) Good | ||
else All | ||
if (tier == top.toString) top | ||
else if (tier == good.toString) good | ||
else all |
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
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
Oops, something went wrong.