tournament perfType old icon chars for mobile app BC

for veloce/lichobile#1724
This commit is contained in:
Thibault Duplessis 2021-06-15 14:07:56 +02:00
parent 0c0cfb8ca2
commit cec1f5fd3b

View file

@ -564,12 +564,19 @@ object JsonView {
.add("iconFont" -> s.iconFont)
}
private val mobileBcIcons: Map[PerfType, String] = Map(
PerfType.UltraBullet -> "{",
PerfType.Bullet -> "T",
PerfType.Blitz -> ")",
PerfType.Rapid -> "#",
PerfType.Classical -> "+"
)
implicit private[tournament] def perfTypeWrites(implicit lang: Lang): OWrites[PerfType] =
OWrites { pt =>
Json.obj(
"icon" -> pt.iconChar.toString,
"name" -> pt.trans
)
Json
.obj("name" -> pt.trans)
.add("icon" -> mobileBcIcons.get(pt)) // mobile BC only
}
implicit private[tournament] val statsWrites: Writes[TournamentStats] = Json.writes[TournamentStats]