mention imported games in PGN - closes #813

pull/835/head
Thibault Duplessis 2015-08-20 15:16:34 +02:00
parent aa8ec27de9
commit 7ee76d703e
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -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)),