Esempio n. 1
0
        /// <summary>
        /// </summary>
        private void PopulateWithFakeData()
        {
            var newList = new PanelControl();
            var rng     = new Random();

            for (var i = 0; i < 50; i++)
            {
                long score = 10000 - i * 10;
                var  time  = TimeSpan.FromSeconds(rng.Next(60, 3600));
                newList.AddChild(CreateLeaderboardEntryControl("player" + i, score, time));
            }
            newList.LayoutColumn(0, 0, 0);

            if (_resultListControl != null)
            {
                RemoveChild(_resultListControl);
            }
            _resultListControl = newList;
            AddChild(_resultListControl);
            LayoutColumn(0, 0, 0);
        }
Esempio n. 2
0
        private void PopulateWithFakeData()
        {
            PanelControl newList = new PanelControl();
            Random rng = new Random();
            for (int i = 0; i < 50; i++)
            {
                long score = 10000 - i * 10;
                TimeSpan time = TimeSpan.FromSeconds(rng.Next(60, 3600));
                newList.AddChild(CreateLeaderboardEntryControl("player" + i.ToString(), score, time));
            }
            newList.LayoutColumn(0, 0, 0);

            if (resultListControl != null)
            {
                RemoveChild(resultListControl);
            }
            resultListControl = newList;
            AddChild(resultListControl);
            LayoutColumn(0, 0, 0);
        }
        private void Populate()
        {
            try
            {
                List<Score> highSores = new List<Score>();

                PanelControl newList = new PanelControl();

                if (HighScores.scores.Count > 0)
                {
                    Thread.Sleep(3000);

                    highSores = HighScores.scores;
                    foreach (var s in highSores)
                    {
                        newList.AddChild(CreateLeaderboardEntryControl(s.name, s.score, s.time));
                        _count++;
                    }
                    if (_count == HighScores.scores.Count)
                    {
                        Populated = true;
                    }
                   // newList.RemoveChildAt(0);
                }
                else
                {
                    newList.AddChild(CreateLeaderboardEntryControl(Message, " ", " "));
                }
                newList.LayoutColumn(0, 0, 0);

                if (resultListControl != null)
                {
                    RemoveChild(resultListControl);
                }
                resultListControl = newList;
                AddChild(resultListControl);
                LayoutColumn(0, 0, 0);
            }
            catch
            {

            }
        }