public void UpdateRollTwoScore(RollTwoScore rollTwoScore) { var frame = GetFrame(rollTwoScore.FrameNumber); var playerScore = GetPlayerScore(frame, rollTwoScore.PlayerId); UpdateRollTwo(rollTwoScore, playerScore); if (frame.FrameNumber > 1 && frame.FrameNumber < 11) { PlayerScore previousFramePlayerScore = GetPreviousFramePlayerScore(rollTwoScore, frame); if (previousFramePlayerScore.FirstRoll.WasStrike) { previousFramePlayerScore.TotalPoints += playerScore.FirstRoll.Points + playerScore.SecondRoll.Points; playerScore.TotalPoints += previousFramePlayerScore.TotalPoints; } } playerScore.TotalPoints += rollTwoScore.NumberOfPinsKnockedDown; }
private void UpdateRollOne(RollOneScore rollOneScore, PlayerScore playerScore) { playerScore.FirstRoll.Points = rollOneScore.NumberOfPinsKnockedDown; playerScore.FirstRoll.WasStrike = rollOneScore.WasStrike; }
private void UpdateRollTwo(RollTwoScore playerRollScore, PlayerScore playerScore) { playerScore.SecondRoll.Points = playerRollScore.NumberOfPinsKnockedDown; playerScore.SecondRoll.WasSpare = playerRollScore.WasSpare; }