BalloonsPop.ConsoleUserInterface.GnomController.PrintHighscore C# (CSharp) Метод

PrintHighscore() публичный Метод

Prints the highscore in the rankings section of the view.
public PrintHighscore ( IHighscoreTable table ) : void
table IHighscoreTable
Результат void
        public void PrintHighscore(IHighscoreTable table)
        {
            this.View[ScoreBoxId].Style.Color = ConsoleColor.White;

            var rankings = table.Table;
            for (int i = 0; i < rankings.Count; i++)
            {
                // TODO: extract in resource provider
                var scoreToAdd = new TextElement(rankings[i].Stringify(i + 1));
                scoreToAdd.Style.PaddingTop = (i * PlayerScoreMargin) + 1;

                this.View.AddChildToParent(this.View[ScoreBoxId], scoreToAdd);
                this.View[ScoreBoxId].Style.Height = table.Table.Count * HighscoreTableHeightIncrement;
            }
        }