Exemplo n.º 1
0
 public void InsertHeading(int index, EndGameStatistics.Heading heading)
 {
     if (heading.Title != null)
         InsertTextItem(index++, true, heading.Title, null, heading.Updateable ? "uz1" + heading.Title : "");
     foreach (var item in heading.Items)
         InsertTextItem(index++, false, item.Key, item.Value, heading.Updateable ? "uz1" + heading.Title + item.Key : "");
 }
Exemplo n.º 2
0
 public void AddHeading(EndGameStatistics.Heading heading)
 {
     if (heading.Title != null)
         AddTextItem(true, heading.Title, null, heading.Updateable ? "uz1" + heading.Title : "");
     foreach (var item in heading.Items)
         AddTextItem(false, item.Key, item.Value, heading.Updateable ? "uz1" + heading.Title + item.Key : "");
 }
Exemplo n.º 3
0
        public override void PrepareStatistics()
        {
            goalLineTimes[0] = StartTime;
            TotalRaceTime = goalLineTimes[goalLineTimes.Count - 1] - goalLineTimes[0];
            players.Find(p => p.LOCAL_PLAYER).RaceTime = TotalRaceTime;

            var playerHeading = new EndGameStatistics.Heading();
            playerHeading.Title = null;
            playerHeading.Updateable = true;
            foreach (var player in players)
                playerHeading.Items[PlayerPlace + ". " + player.PlayerName] = TotalRaceTime.ToString(@"m\:ss\:ff");

            var lapsHeading = new EndGameStatistics.Heading();
            lapsHeading.Title = "Your times";
            for (int i = 1; i < goalLineTimes.Count; i++)
            {
                var lapTime = goalLineTimes[i] - goalLineTimes[i - 1];
                lapsHeading.Items["Lap " + i] = lapTime.ToString(@"m\:ss\:ff");
            }

            /*var statsHeading = new EndGameStatistics.Heading();
            statsHeading.Title = "Statistics";
            statsHeading.Items["You suck"] = null;*/

            var itemList = new List<EndGameStatistics.Heading> { playerHeading, lapsHeading/*, statsHeading*/ };

            bool won = PlayerPlace == 1;
            Statistics = new EndGameStatistics(itemList, won);
        }