コード例 #1
0
        private void timeline_PlaybackPositionChanged(object sender, EventArgs e)
        {
            var text = "";

            BeginPlayerListUpdate();
            minimap.BeginUpdate();

            foreach (var playerInfo in _demo.ReadPlayerInfos(timeline.PlaybackPosition))
            {
                minimap.UpdatePlayer(playerInfo, _demo);
                UpdatePlayerListPlayer(playerInfo);

                if (_selectedPlayers.Contains(playerInfo.EntityID))
                {
                    text += $@"{playerInfo.State.Name} Statistics:

Kills: {playerInfo.Statistics.Kills}
Deaths: {playerInfo.Statistics.Deaths}
K/D Ratio: {(double)playerInfo.Statistics.Kills / (double)playerInfo.Statistics.Deaths:F2}
Assists: {playerInfo.Statistics.Assists}
Score: {playerInfo.Statistics.Score}
MVPs: {playerInfo.Statistics.MVPs}
Ping: {playerInfo.Statistics.Ping}
Clantag: {playerInfo.Statistics.Clantag}
TotalCashSpent: {playerInfo.Statistics.TotalCashSpent}

";
                }
            }

            EndPlayerListUpdate();
            minimap.EndUpdate();

            if (text == "")
            {
                playerInfos.Text = "Click on a player to view more information about them.";
            }
            else
            {
                playerInfos.Text = text;
            }

            killfeed.SetKills(_demo.ReadRecentKills(timeline.PlaybackPosition, 5));
        }