コード例 #1
0
ファイル: Game.cs プロジェクト: snagbg/golacorp-scorekeeper
        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;
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: snagbg/golacorp-scorekeeper
 private void UpdateRollOne(RollOneScore rollOneScore, PlayerScore playerScore)
 {
     playerScore.FirstRoll.Points    = rollOneScore.NumberOfPinsKnockedDown;
     playerScore.FirstRoll.WasStrike = rollOneScore.WasStrike;
 }
コード例 #3
0
ファイル: Game.cs プロジェクト: snagbg/golacorp-scorekeeper
 private void UpdateRollTwo(RollTwoScore playerRollScore, PlayerScore playerScore)
 {
     playerScore.SecondRoll.Points   = playerRollScore.NumberOfPinsKnockedDown;
     playerScore.SecondRoll.WasSpare = playerRollScore.WasSpare;
 }