infer that game is from position if a FEN is given in the import
This commit is contained in:
parent
122845ec61
commit
5f3ef2f704
|
@ -31,8 +31,10 @@ private[importer] case class ImportData(pgn: String) {
|
||||||
def tag(which: Tag.type ⇒ TagType): Option[String] =
|
def tag(which: Tag.type ⇒ TagType): Option[String] =
|
||||||
tags find (_.name == which(Tag)) map (_.value)
|
tags find (_.name == which(Tag)) map (_.value)
|
||||||
|
|
||||||
val variant = tag(_.Variant).flatMap(v ⇒ Variant(v.value)) | Variant.Standard
|
|
||||||
val initBoard = tag(_.FEN) flatMap Forsyth.<< map (_.board)
|
val initBoard = tag(_.FEN) flatMap Forsyth.<< map (_.board)
|
||||||
|
val variant = tag(_.Variant).flatMap(v ⇒ Variant(v.value)) | {
|
||||||
|
initBoard.nonEmpty.fold(Variant.FromPosition, Variant.Standard)
|
||||||
|
}
|
||||||
|
|
||||||
val result = tag(_.Result) filterNot (_ ⇒ game.situation.end) collect {
|
val result = tag(_.Result) filterNot (_ ⇒ game.situation.end) collect {
|
||||||
case "1-0" ⇒ Result(Status.Resign, Color.White.some)
|
case "1-0" ⇒ Result(Status.Resign, Color.White.some)
|
||||||
|
|
1
todo
1
todo
|
@ -64,4 +64,3 @@ edit board from play fen
|
||||||
clickable mistakes list in analysis
|
clickable mistakes list in analysis
|
||||||
FEN/editor castle/enpassant https://github.com/ornicar/lila/issues/42
|
FEN/editor castle/enpassant https://github.com/ornicar/lila/issues/42
|
||||||
stupid team forum slug http://ru.lichess.org/forum/team-4epa250h
|
stupid team forum slug http://ru.lichess.org/forum/team-4epa250h
|
||||||
import PGN with FEN position without chess960 (handicap) (claymore on #chess)
|
|
||||||
|
|
Loading…
Reference in a new issue