/// <summary> /// Reset game and clear score /// </summary> public void ResetGame() { _tenPinBowlingFrames = new TenPinBowlingFrame[10]; _tenPinBowlingFrames[0] = new TenPinBowlingNormalFrame(); _currentFrame = 0; _tenPinBowlingScore.ClearScore(); }
public TenPinBowlingGame(ITenPinBowlingScore tenPinBowlingScore) { _tenPinBowlingFrames = new TenPinBowlingFrame[10]; _tenPinBowlingFrames[0] = new TenPinBowlingNormalFrame(); _tenPinBowlingScore = tenPinBowlingScore; }
/// <summary> /// Setup the next frame in the game /// </summary> public void NextFrame() { if (!IsGameOver()) { if (_currentFrame < 8) { _tenPinBowlingFrames[++_currentFrame] = new TenPinBowlingNormalFrame(); } else { _tenPinBowlingFrames[++_currentFrame] = new TenPinBowlingLastFrame(); } } }