private void Stat_Click(object sender, RoutedEventArgs e)
        {
            RankSimulatorStatistics.GetTagRanking(sys).ForEach(x =>
            {
                if (x.Win + x.Lose + x.Draw == 0)
                {
                    return;
                }
                Monitor.Instance.Push($"{x.Win}승".PadLeft(6) + $"{x.Lose}패".PadLeft(6) + $"{x.Draw}무".PadLeft(6) + $" ({(x.W * 100).ToString("0.###")}%):".PadLeft(12) + "  " + $"{x.Indentity}".PadRight(32) + $"{x.Rating.ToString("0.##")}점".PadLeft(14));
            });

            RankSimulatorStatistics.GetArtistRanking(sys).ForEach(x =>
            {
                if (x.Win + x.Lose + x.Draw == 0)
                {
                    return;
                }
                Monitor.Instance.Push($"{x.Win}승".PadLeft(6) + $"{x.Lose}패".PadLeft(6) + $"{x.Draw}무".PadLeft(6) + $" ({(x.W * 100).ToString("0.###")}%):".PadLeft(12) + "  " + $"{x.Indentity}".PadRight(32) + $"{x.Rating.ToString("0.##")}점".PadLeft(14));
            });
        }
        private void Export_Click(object sender, RoutedEventArgs e)
        {
            var builder = new StringBuilder();

            builder.Append("Koromo Copy Rank Simulator\r\n");
            builder.Append("Copyright (C) 2018-2020. dc-koromo. All Rights Reserved.\r\n");
            builder.Append("\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            builder.Append("                                    통산 기록\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            builder.Append($" 게임 횟수: {sys.Model.DHistory.Count}\r\n");
            builder.Append($" 참가자 수: {sys.Players.Count}\r\n");
            builder.Append("\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            builder.Append("                                   전체 게임 기록\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            int gc = 0;

            sys.Model.DHistory.ForEach(x =>
            {
                builder.Append($" {(++gc).ToString("#,#").PadLeft(7)} 게임: {sys.Players[x.Item1].Indentity.PadLeft(30)} ({x.Item4.ToString().PadLeft(7)}) vs {sys.Players[x.Item2].Indentity.PadLeft(30)} ({x.Item5.ToString().PadLeft(7)}) ");

                if (x.Item3 == 1)
                {
                    builder.Append($"       Left Win\r\n");
                }
                else
                {
                    builder.Append($"       Draw\r\n");
                }
            });
            builder.Append("\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            builder.Append("                                태그 엘로 레이팅 기록\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            RankSimulatorStatistics.GetTagRanking(sys).ForEach(x =>
            {
                if (x.Win + x.Lose + x.Draw == 0)
                {
                    return;
                }
                builder.Append($"{x.Win}승".PadLeft(6) + $"{x.Lose}패".PadLeft(6) + $"{x.Draw}무".PadLeft(6) + $" ({(x.W * 100).ToString("0.###")}%):".PadLeft(12) + "  " + $"{x.Indentity}".PadRight(32) + $"{x.Rating.ToString("0.##")}점".PadLeft(14) + "\r\n");
            });
            builder.Append("\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            builder.Append("                                작가 엘로 레이팅 기록\r\n");
            builder.Append("\r\n");
            builder.Append("=================================================================================\r\n");
            builder.Append("\r\n");
            RankSimulatorStatistics.GetArtistRanking(sys).ForEach(x =>
            {
                if (x.Win + x.Lose + x.Draw == 0)
                {
                    return;
                }
                builder.Append($"{x.Win}승".PadLeft(6) + $"{x.Lose}패".PadLeft(6) + $"{x.Draw}무".PadLeft(6) + $" ({(x.W * 100).ToString("0.###")}%):".PadLeft(12) + "  " + $"{x.Indentity}".PadRight(32) + $"{x.Rating.ToString("0.##")}점".PadLeft(14) + "\r\n");
            });
            builder.Append("\r\n");
            builder.Append("끝");

            File.WriteAllText("rank-simulator-result.log", builder.ToString());
            Process.Start("notepad", "rank-simulator-result.log");
        }
        private async void LoadNext()
        {
            await Application.Current.Dispatcher.BeginInvoke(new Action(
                                                                 delegate
            {
                LeftImage.Source = null;
                LeftProgress.Visibility = Visibility.Visible;
                RightImage.Source = null;
                RightProgress.Visibility = Visibility.Visible;
            }));

            var exclude  = RankSimulatorStatistics.FilterClosingArtists(sys);
            var ava_list = new List <int>();

            for (int i = 0; i < sys.Players.Count; i++)
            {
                if (!exclude.Contains(i))
                {
                    ava_list.Add(i);
                }
            }

            var max     = ava_list.Count;
            var rand    = new Random();
            var r_count = 0;

RETRY:
            if (r_count == 10)
            {
                await Application.Current.Dispatcher.BeginInvoke(new Action(
                                                                     delegate
                {
                    MessageBox.Show("몇 가지 오류가 발생하여 진행할 수 없습니다. 개발자에게 문의하세요!", Title, MessageBoxButton.OK, MessageBoxImage.Error);
                }));

                return;
            }
            r_count++;
            var first  = ava_list[rand.Next(max)];
            var second = ava_list[rand.Next(max)];

            if (first == second)
            {
                goto RETRY;
            }

            var fresult = await HitomiDataParser.SearchAsync($"artist:{sys.Players[first].Indentity}");

            var sresult = await HitomiDataParser.SearchAsync($"artist:{sys.Players[second].Indentity}");

            if (fresult.Count == 0)
            {
                fresult = await HitomiDataParser.SearchAsync($"group:{sys.Players[first].Indentity}");
            }
            if (sresult.Count == 0)
            {
                sresult = await HitomiDataParser.SearchAsync($"group:{sys.Players[second].Indentity}");
            }

            if (fresult.Count == 0 || sresult.Count == 0)
            {
                goto RETRY;
            }

            left  = first;
            right = second;

            var ffirst  = rand.Next(fresult.Count);
            var ssecond = rand.Next(sresult.Count);

            await Application.Current.Dispatcher.BeginInvoke(new Action(
                                                                 delegate
            {
                LeftText.Text = sys.Players[first].Indentity;
                RightText.Text = sys.Players[second].Indentity;
            }));

            LoadLeftImage(await GetThumbnailAddress(id1  = fresult[ffirst].ID));
            LoadRightImage(await GetThumbnailAddress(id2 = sresult[ssecond].ID));
        }