@@ -9,7 +9,7 @@ import chess.format.{ Fen, Uci }
99import chess .opening .{ Opening , OpeningDb }
1010import chess .variant .Variant
1111import chess .format .pgn .SanStr
12- import chess .{ ByColor , Castles , Centis , CheckCount , Clock , Color , Game as ChessGame , Mode , Status }
12+ import chess .{ ByColor , Castles , Centis , CheckCount , Clock , Color , Game as ChessGame , Rated , Status }
1313
1414import lila .common .Sequence
1515import lila .db .ByteArray
@@ -22,13 +22,13 @@ case class Game(
2222 daysPerTurn : Option [Int ],
2323 binaryMoveTimes : Option [ByteArray ] = None ,
2424 clockHistory : Option [ClockHistory ] = Option (ClockHistory ()),
25- mode : Mode = Mode .default,
25+ rated : Rated = Rated .default,
2626 createdAt : Instant ,
2727 movedAt : Instant ,
2828 metadata : Metadata
2929):
30- export chess .{ clock , player as turnColor , ply , sans , board , startedAtPly }
31- export chess .board .{ history , variant }
30+ export chess .{ clock , player as turnColor , ply , sans , position , startedAtPly }
31+ export chess .position .{ history , variant }
3232
3333 def player : Player = players(turnColor)
3434
@@ -147,10 +147,7 @@ case class Game(
147147
148148 def aiPov : Option [Pov ] = players.find(_.isAi).map(_.color).map(pov)
149149
150- def boosted = rated && finished && bothPlayersHaveMoved && playedTurns < 10
151-
152- def rated = mode.rated
153- def casual = ! rated
150+ def boosted = rated.yes && finished && bothPlayersHaveMoved && playedTurns < 10
154151
155152 def finished = status >= Status .Mate
156153
@@ -197,7 +194,7 @@ case class Game(
197194 def startColor = startedAtPly.turn
198195
199196 def ratingVariant =
200- if isTournament && board .variant.fromPosition then _root_.chess.variant.Standard
197+ if isTournament && position .variant.fromPosition then _root_.chess.variant.Standard
201198 else variant
202199
203200 def fromPosition = variant.fromPosition || source.contains(Source .Position )
0 commit comments