Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 private void UpdateRollOne(RollOneScore rollOneScore, PlayerScore playerScore)
 {
     playerScore.FirstRoll.Points    = rollOneScore.NumberOfPinsKnockedDown;
     playerScore.FirstRoll.WasStrike = rollOneScore.WasStrike;
 }
Esempio n. 3
0
 private void UpdateRollTwo(RollTwoScore playerRollScore, PlayerScore playerScore)
 {
     playerScore.SecondRoll.Points   = playerRollScore.NumberOfPinsKnockedDown;
     playerScore.SecondRoll.WasSpare = playerRollScore.WasSpare;
 }