finishRound method Null safety

GenericGame finishRound(
  1. [Map<PlayerID, double>? scores]
)

Returns a copy of the GenericGame with the round incremented, status set to GameStatus.Started and optionally the players' scores added to allRoundScores

Implementation

GenericGame finishRound([Map<PlayerID, double>? scores]) => scores != null
    ? updateScores(scores).copyWith(
        round: round + 1,
        status: GameStatus.Started,
      )
    : copyWith(round: round + 1, status: GameStatus.Started);