public void RollBall() { if (!GameOver()) { if (cheatActivated || loseActivated) { firstRoll = cheatActivated ? 10 : 0; } else { firstRoll = GetRandomNumber(min_, max_); secondRoll = (firstRoll == 10) ? 0 : GetRandomNumber(min_, (max_ - firstRoll)); } if (LastTurn()) { if (firstRoll + secondRoll == 10) { Add(Frame.Roll((firstRoll + InitiateBonus()), secondRoll)); } else { Add(Frame.Roll(firstRoll, secondRoll)); } } else { Add(Frame.Roll(firstRoll, secondRoll)); } Update(firstRoll, secondRoll); } }
public void Roll(int pins) { lastWasSpare = previousFrame.IsSpare(); lastWasSpare = previousFrame.IsStrike(); currentFrame.Roll(pins); }