Пример #1
0
        public Dictionary <string, string> DataToDict()
        {
            Dictionary <string, string> result = new Dictionary <string, string>
            {
                ["experience"]        = Experience.ToString(),
                ["kills"]             = Kills.ToString(),
                ["leaks"]             = Leaks.ToString(),
                ["builds"]            = Builds.ToString(),
                ["sends"]             = Sends.ToString(),
                ["earned_tangos"]     = EarnedTangos.ToString(),
                ["won_games"]         = WonGames.ToString(),
                ["won_duels"]         = WonDuels.ToString(),
                ["lost_games"]        = LostGames.ToString(),
                ["lost_duels"]        = LostDuels.ToString(),
                ["win_rate"]          = WinRate.ToString(),
                ["duel_win_rate"]     = DuelWinRate.ToString(),
                ["rating"]            = Rating.ToString(),
                ["earned_gold"]       = EarnedGold.ToString(),
                ["gold_per_minute"]   = GoldPerMinute.ToString(),
                ["tangos_per_minute"] = TangosPerMinute.ToString(),
                ["time_played"]       = TimePlayed.ToString()
            };

            // foreach (var data in FractionDatas) {
            //     result[KilledPrefix + data.FractionName] = data.Killed.ToString();
            //     result[PlayedPrefix + data.FractionName] = data.Played.ToString();
            // }
            foreach (var pair in PlayedFractions)
            {
                result[pair.Key] = pair.Value.ToString();
            }
            // foreach (var pair in FractionKills)
            //     result[pair.Key] = pair.Value.ToString();
            return(result);
        }
Пример #2
0
        // Prepare codebase for display
        public void Normalize()
        {
            Leaks = Leaks.OrderByDescending(x => x.TotalLeak).ToList();

            MaxLeak = Leaks.Any() ? Leaks.Max(x => x.TotalLeak) : 1;
            foreach (var leak in Leaks)
            {
                leak.NormalizedTotalLeak = (double)leak.TotalLeak / MaxLeak;
            }

            Lines = Lines.OrderBy(x => x.Function.Name).ToList();
        }
Пример #3
0
        public void AddLeak()
        {
            var tempLeak = new Leak()
            {
                CreateDate = LeakInfo.CreateDate,
                Title      = LeakInfo.Title,
                Comments   = new ObservableCollection <Comment>()
            };
            var tempComment = new Comment()
            {
                CreateDate = LeakInfo.CreateDate,
                Text       = CommentInfo.Text
            };

            tempLeak.Comments.Add(tempComment);
            Leaks.Add(tempLeak);
            _dataService.SaveLeaks(Leaks);
            RaisePropertyChanged("Leaks");
            LeakInfo    = new Leak();
            CommentInfo = new Comment();
        }
Пример #4
0
        public void DeleteLeak(DateTime ldate)
        {
            Leak found = null;

            foreach (var item in Leaks)
            {
                if (item.CreateDate == ldate)
                {
                    found = item;
                }
            }
            if (found != null)
            {
                Leaks.Remove(found);
                _dataService.SaveLeaks(Leaks);
            }
            else
            {
                Console.WriteLine("Leak date not found!");
            }
        }
Пример #5
0
        // Add new backtrace
        public void AddBacktrace(List <string> lines, int startLine, int endLine)
        {
            var newTrace = Backtrace.FromLines(this, lines, startLine, endLine);

            Leaks.Add(newTrace);
        }