BalloonsPop.GraphicUserInterface.MainWindowController.PrintHighscore C# (CSharp) Method

PrintHighscore() public method

Updates the ranking of the view based on the provided IHighscoreTable instance.
public PrintHighscore ( IHighscoreTable table ) : void
table IHighscoreTable The highscore table on which the introduced changes are based.
return void
        public void PrintHighscore(IHighscoreTable table)
        {
            this.Window.Rankings.Children.Clear();

            var tableAsMapList = table.ToStringLists();

            int rowIndex = 0;

            tableAsMapList.ForEach(record =>
            {
                int colIndex = 0;

                record.ForEach(infoField =>
                {
                    infoField
                        .WrapInTextBox(this.Resources.HighscoreGridCell.Clone())
                        .WrapInBorder(this.Resources.HighscoreGridBorder.Clone())
                        .SetGridRow(rowIndex)
                        .SetGridCol(colIndex++)
                        .AddAsChildTo(this.Window.Rankings);
                });

                rowIndex++;
            });
        }