private static AbstractFrame GetInput(short frameIndex) { AbstractFrame frame = null; Console.WriteLine("Input for Frame-{0} ", frameIndex); Bowl bowl1 = RollFirstBowl(); Bowl bowl2 = RollSecondBowl(bowl1, frameIndex); frame = new Frame(bowl1, bowl2, frameIndex); if (frameIndex == 10 && (frame.IsStrike || frame.IsSpare)) { Bowl bowl3 = RollThirdBowl(bowl2); frame = new LastFrame(bowl1, bowl2, bowl3, frameIndex); } return frame; }
private static AbstractFrame GetInput(short frameIndex) { AbstractFrame frame = null; Console.WriteLine("Input for Frame-{0} ", frameIndex); Bowl bowl1 = RollFirstBowl(); Bowl bowl2 = RollSecondBowl(bowl1, frameIndex); frame = new Frame(bowl1, bowl2, frameIndex); if (frameIndex == 10 && (frame.IsStrike || frame.IsSpare)) { Bowl bowl3 = RollThirdBowl(bowl2); frame = new LastFrame(bowl1, bowl2, bowl3, frameIndex); } return(frame); }