示例#1
0
        private void Trial_Button_Click(object sender, EventArgs e)
        {
            Gengar.Clear();
            for (int i = 0; i < Expe_Times_02; i++)
            {
                int _count = BM_02.Trial(Trial_Times_02);
                int _index = Gengar.FindIndex(x => x._outcome == _count);

                if (_index >= 0)
                {
                    Gengar[_index]._times++;
                }
                else
                {
                    Gengar.Add(new OutComeNTimes(_count, 1));
                }
            }
            Gengar.Sort(SC);
            //
            this.Refresh();
        }
示例#2
0
        private void Pepe01_Paint(object sender, PaintEventArgs e)
        {
            using (Graphics g = this.CreateGraphics())
            {
                g.Clear(this.BackColor);
                g.DrawLine(new Pen(mainColor, 3), new Point(20, 20), new Point(20, 421));
                g.DrawLine(new Pen(mainColor, 3), new Point(20, 421), new Point(1200, 421));
                //

                int        minimum = 0, maximum = 0, x_crnt = 40, y_crnt = 420;
                SolidBrush brush_01 = new SolidBrush(Color_01), brush_02 = new SolidBrush(Color_02), brush_text = new SolidBrush(Color.FromArgb(195, 49, 237));
                Font       _font = new Font("Andalus", 10);

                if (Gardevoir.Count != 0)
                {
                    if (Gengar.Count != 0)
                    {
                        minimum = (Gardevoir[0]._outcome < Gengar[0]._outcome) ? Gardevoir[0]._outcome : Gengar[0]._outcome;
                        maximum =
                            (Gardevoir[Gardevoir.Count - 1]._outcome > Gengar[Gengar.Count - 1]._outcome) ? Gardevoir[Gardevoir.Count - 1]._outcome : Gengar[Gengar.Count - 1]._outcome;
                    }
                    else
                    {
                        minimum = Gardevoir[0]._outcome;
                        maximum = Gardevoir[Gardevoir.Count - 1]._outcome;
                    }
                }
                else if (Gengar.Count != 0)
                {
                    if (Gardevoir.Count != 0)
                    {
                        minimum = (Gardevoir[0]._outcome < Gengar[0]._outcome) ? Gardevoir[0]._outcome : Gengar[0]._outcome;
                        maximum =
                            (Gardevoir[Gardevoir.Count - 1]._outcome > Gengar[Gengar.Count - 1]._outcome) ? Gardevoir[Gardevoir.Count - 1]._outcome : Gengar[Gengar.Count - 1]._outcome;
                    }
                    minimum = Gengar[0]._outcome;
                    maximum = Gengar[Gengar.Count - 1]._outcome;
                }
                //
                for (int i = minimum; i <= maximum; i++)
                {
                    int _index = Gardevoir.FindIndex(x => x._outcome == i);
                    if (_index >= 0)
                    {
                        g.FillRectangle(brush_01, x_crnt, (y_crnt - Gardevoir[_index]._times * 10), 14, (Gardevoir[_index]._times * 10));
                    }

                    int _index_02 = Gengar.FindIndex(x => x._outcome == i);
                    if (_index_02 >= 0)
                    {
                        g.FillRectangle(brush_02, x_crnt, (y_crnt - Gengar[_index_02]._times * 10), 14, (Gengar[_index_02]._times * 10));
                    }

                    if (_index >= 0 || _index_02 >= 0)
                    {
                        g.DrawString(i.ToString(), _font, brush_text, new Point(x_crnt, y_crnt + 5));
                        x_crnt += 16;
                    }
                }
            }
        }