Exemplo n.º 1
0
        public int[] CalulatePoints(IEnumerable <int[]> scores)
        {
            var firstFrameLink = _linker.LinkFrames(scores);

            var points = new List <int>();

            for (BaseFrame currentFrame = firstFrameLink; currentFrame != null; currentFrame = currentFrame.NextFrame)
            {
                int newTotal = points.ElementAtOrDefault(points.Count() - 1) + currentFrame.Calculate();

                points.Add(newTotal);
            }

            return(points.ToArray <int>());
        }
Exemplo n.º 2
0
 public static bool IsStrike(this BaseFrame frame)
 {
     return(frame.FirstShot == 10);
 }