BalloonsPop.GraphicUserInterface.Gadgets.IHighscoreTableExtensions.ToStringLists C# (CSharp) Method

ToStringLists() public static method

Converts the calling IHighscoreTable to a list of lists of strings.
public static ToStringLists ( this table ) : IList>
table this The table that will be converted to string lists.
return IList>
        public static IList<IList<string>> ToStringLists(this IHighscoreTable table)
        {
            if (table == null)
            {
                throw new NullReferenceException("Provided table was null");
            }

            var result = new List<IList<string>>();

            var index = 1;

            foreach (var record in table.Table)
            {
                var currentRecord = new List<string>();

                currentRecord.Add((index++).ToString());
                currentRecord.Add(record.Name);
                currentRecord.Add(record.Moves.ToString());

                result.Add(currentRecord);
            }

            return result;
        }
IHighscoreTableExtensions