Exemplo n.º 1
0
        /// <summary>
        /// Get the next two non-null scores in this frame and return it.
        /// If there is only one score in this frame, the second score will come from the next frame.
        /// </summary>
        /// <returns>List of the next two scores in the next one or two frames.</returns>
        public List <int> GetNextTwoScores()
        {
            List <int> nextTwoScores = new List <int>();

            foreach (int?score in Scores)
            {
                if (score != null)
                {
                    nextTwoScores.Add((int)score);
                    if (nextTwoScores.Count == 2)
                    {
                        return(nextTwoScores);
                    }
                }
            }

            if (NextFrame != null)
            {
                nextTwoScores.Add(NextFrame.GetNextScore());
            }

            return(nextTwoScores);
        }