Ejemplo n.º 1
0
        private int ScoreTenthFrame(BowlingFrame frame)
        {
            if (IsStrike(frame) || IsSpare(frame))
            {
                frame.FinishedEnteringRolls = false;
                frame.HasTenthFrameBonus    = true;
            }
            else
            {
                frame.HasTenthFrameBonus = false;
            }

            if (frame.SecondRollScore == STRIKE_VALUE)
            {
                frame.FinishedEnteringRolls = false;
            }

            if (frame.HasTenthFrameBonus && !string.IsNullOrEmpty(frame.BonusRollString))
            {
                frame.FinishedEnteringRolls = true;
                frame.FinishedScoring       = true;
            }

            return(frame.FirstRollScore + frame.SecondRollScore + frame.BonusRollScore);
        }
Ejemplo n.º 2
0
 private bool IsSpare(BowlingFrame frame)
 {
     return(frame.FirstRollScore + frame.SecondRollScore == STRIKE_VALUE);
 }
Ejemplo n.º 3
0
 private bool IsStrike(BowlingFrame frame)
 {
     return(frame.FirstRollScore == STRIKE_VALUE);
 }