private void rollMany(int rolls, int pins) { for (int i = 0; i < rolls; i++) { _contestant.Roll(pins); } }
/// <summary> /// /// </summary> /// <param name="contest"></param> /// <param name="rollInput"></param> /// <returns>The amount of pins that can be thrown on next throw, -1 if player game is done</returns> public static int Roll(this IContest contest, Roll rollInput) { IContestant contestant = contest.Contestants.FirstOrDefault(x => x.ContestantName == rollInput.ContestantName); int pins = 0; if (!contestant.IsInstanceComplete) { pins = contestant.Roll(rollInput.PinsKnocked); } return(contestant.IsInstanceComplete ? -1 : pins); }