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); }
private bool IsSpare(BowlingFrame frame) { return(frame.FirstRollScore + frame.SecondRollScore == STRIKE_VALUE); }
private bool IsStrike(BowlingFrame frame) { return(frame.FirstRollScore == STRIKE_VALUE); }