Пример #1
0
 protected void DisplayDescription(Replay rp)
 {
     // replay version
     infoLV.Items[0].SubItems[1].Text = "1." + rp.Version;
     // map name
     infoLV.Items[1].SubItems[1].Text = Path.GetFileName(rp.Map.Path);
     // map location
     infoLV.Items[2].SubItems[1].Text = Path.GetDirectoryName(rp.Map.Path);
     // host name
     infoLV.Items[3].SubItems[1].Text = rp.Host.Name;
     // game mode
     infoLV.Items[4].SubItems[1].Text = rp.GameMode;
     // game length
     infoLV.Items[5].SubItems[1].Text = DHFormatter.ToString(rp.GameLength);
     // sentinel players
     infoLV.Items[6].SubItems[1].Text = rp.GetTeamByType(TeamType.Sentinel).Players.Count.ToString();
     // scourge players
     infoLV.Items[7].SubItems[1].Text = rp.GetTeamByType(TeamType.Scourge).Players.Count.ToString();
     // winner
     string winner = "Winner info not found";
     infoLV.Items[8].SubItems[1].ForeColor = Color.Black;
     foreach (Team t in rp.Teams)
         if (t.IsWinner)
         {
             winner = t.Type.ToString();
             infoLV.Items[8].SubItems[1].ForeColor = (t.Type == TeamType.Sentinel) ? Color.Red : Color.Green;
             break;
         }
     infoLV.Items[8].SubItems[1].Text = winner;
 }