Skip to content

Commit

Permalink
use scalachess result parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Feb 12, 2025
1 parent 808c76b commit f944525
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/tree/src/main/ParseImport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ val parseImport: PgnStr => Either[ErrorStr, ImportResult] = pgn =>

val status = parsed.tags(_.Termination).map(_.toLowerCase) match
case Some("normal") =>
game.situation.status | (if parsed.tags(_.Result).getOrElse("") === "1/2-1/2" then Status.Draw
else Status.Resign)
game.situation.status |
(if parsed.tags.outcome.exists(_.winner.isEmpty) then Status.Draw else Status.Resign)
case Some("abandoned") => Status.Aborted
case Some("time forfeit") => Status.Outoftime
case Some("rules infraction") => Status.Cheat
Expand Down

0 comments on commit f944525

Please sign in to comment.