コード例 #1
0
        // Output scoreboard
        private void SetPlayers()
        {
            var users = wordInstance.GetPlayerList();

            PlayerBoard.Children.Clear();
            ScoreBoard.Children.Clear();
            WordCount.Children.Clear();

            foreach (var item in users)
            {
                // Output Player Name
                Label name = new Label
                {
                    Content = item._PlayerName,
                    Width   = 70
                };
                // Output Player score
                Label score = new Label
                {
                    Content = item._TotalPoints,
                    Width   = 70
                };
                // Output Player word count
                Label wordCount = new Label
                {
                    Content = "Word#: " + item.NumWordsGuessed,
                    Width   = 70
                };

                PlayerBoard.Children.Add(name);
                ScoreBoard.Children.Add(score);
                WordCount.Children.Add(wordCount);
            }
        }