mention imported games in PGN - closes #813
parent
aa8ec27de9
commit
7ee76d703e
|
@ -333,9 +333,9 @@ case class Game(
|
|||
|
||||
def fromPosition = variant == chess.variant.FromPosition || source.??(Source.Position==)
|
||||
|
||||
def imported = source exists (_ == Source.Import)
|
||||
def imported = source contains Source.Import
|
||||
|
||||
def isFicsRelay = source ?? (Source.Relay==)
|
||||
def isFicsRelay = source contains Source.Relay
|
||||
|
||||
def winner = players find (_.wins)
|
||||
|
||||
|
|
|
@ -49,7 +49,9 @@ final class PgnDump(
|
|||
|
||||
private def tags(game: Game, initialFen: Option[String]): List[Tag] = gameLightUsers(game) match {
|
||||
case (wu, bu) => List(
|
||||
Tag(_.Event, game.rated.fold("Rated game", "Casual game")),
|
||||
Tag(_.Event,
|
||||
if (game.imported || game.isFicsRelay) "Import"
|
||||
else game.rated.fold("Rated game", "Casual game")),
|
||||
Tag(_.Site, gameUrl(game.id)),
|
||||
Tag(_.Date, dateFormat.print(game.createdAt)),
|
||||
Tag(_.White, player(game.whitePlayer, wu)),
|
||||
|
|
Loading…
Reference in New Issue