Ejemplo n.º 1
0
        public IList<IFrame> Create(IList<int> rolls)
        {
            var rollsWithNullShots = AddNullRollsDueToStrike(rolls);

            var frames = new List<IFrame>();
            IFrame currentFrame = null;

            for (var i = 0; i<rollsWithNullShots.Count; i++)
            {
                if ((i) % _configuration.NumberOfRollsPerFrame == 0)
                {
                    currentFrame = new Frame(frames.Count);
                    frames.Add(currentFrame);
                }

                currentFrame.Rolls.Add(new Roll(rollsWithNullShots[i]));
            }

            return frames;
        }
Ejemplo n.º 2
0
 public void AddFrame(Frame frame)
 {
     this.frames.Add(frame);
 }
Ejemplo n.º 3
0
 private int AddFrameRolls(Frame frame)
 {
     return frame.FirstRoll + frame.SecondRoll;
 }