Exemplo n.º 1
0
        private StringBuilder AvsBReplaysCompare(List <Replay> replaysA, List <Replay> replaysB)
        {
            var sb = new StringBuilder();

            labelTask.Content           = "Comparing replays...";
            progressBar_Analyzing.Value = 0.0;

            int iQueue = 0;
            int iCount = replaysA.Count * replaysB.Count;

            foreach (Replay replayA in replaysA)
            {
                foreach (Replay replayB in replaysB)
                {
                    ReplayComparator comparator = new ReplayComparator(replayA, replayB);
                    double           diff       = comparator.compareReplays();

                    if (diff < 10.0)
                    {
                        sb.Append("IDENTICAL REPLAY PAIR: ");
                    }

                    sb.AppendLine($"{replayA.Filename} vs. {replayB.Filename} = {diff}");

                    progressBar_Analyzing.Value = (100.0 / iCount) * iQueue++;
                }
            }

            progressBar_Analyzing.Value = 100.0;
            labelTask.Content           = "Finished comparing replays.";

            return(sb);
        }
Exemplo n.º 2
0
        private StringBuilder AllVSReplaysCompare(List <Replay> replays)
        {
            var sb = new StringBuilder();

            labelTask.Content           = "Comparing replays...";
            progressBar_Analyzing.Value = 0.0;

            int iFirstQueue = 0;
            int iQueue      = 0;
            int count       = replays.Count * (replays.Count - 1) / 2;

            foreach (var replayA in replays)
            {
                for (int i = iFirstQueue + 1; i < replays.Count; i++)
                {
                    if (replayA.ReplayHash == replays[i].ReplayHash)
                    {
                        continue;
                    }

                    var    comparator = new ReplayComparator(replayA, replays[i]);
                    double diff       = comparator.compareReplays();

                    if (diff < 10.0)
                    {
                        sb.Append("IDENTICAL REPLAY PAIR: ");
                    }

                    sb.AppendLine($"{replayA.Filename} vs. {replays[i].Filename} = {diff}");
                    progressBar_Analyzing.Value = (100.0 / count) * iQueue++;
                }

                iFirstQueue++;
            }

            progressBar_Analyzing.Value = 100.0;
            labelTask.Content           = "Finished comparing replays.";

            return(sb);
        }