コード例 #1
0
 private void Next_Click_1(object sender, EventArgs e)
 {
     if (FormNext == null)
         FormNext = new Form3(this);
     FormNext.Show();
     this.Hide();
 }
コード例 #2
0
        public Form4(Form3 _FormPrev, Form2 _FormPrevPrev)
        {
            InitializeComponent();
            FormPrev = _FormPrev;
            FormPrevPrev = _FormPrevPrev;
            selected_apps = FormPrevPrev.curitems;

            extractPath = (FormPrev.downloadLocation).ToString();
            zipPath = (extractPath + ".zip").ToString();
        }
コード例 #3
0
        public void gameStats()
        {
            string path = @"round" + roundId.ToString() + ".txt";

            using (StreamWriter fs = File.CreateText(path))
            {
                game.future_robots.Sort();
                Form form3 = new Form3();
                form3.Text = "Раунд: " + (roundId + 1).ToString();
                form3.Show();
                int mesto      = 1;
                int countMesto = 0;
                for (int j = game.future_robots.Count - 1; j >= 0; j--)
                {
                    countMesto++;
                    Form3.dataGridView3.Rows.Add();
                    int i = 0;
                    if (j == game.future_robots.Count - 1)
                    {
                        Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = mesto;
                    }
                    else
                    {
                        if (game.future_robots[j].energy != game.future_robots[j + 1].energy)
                        {
                            mesto = countMesto;
                        }
                        Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = mesto;
                    }
                    Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = game.future_robots[j].id;
                    Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = game.future_robots[j].name;
                    Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = game.future_robots[j].defence + game.future_robots[j].attack + game.future_robots[j].speed;
                    Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = game.future_robots[j].energy;
                    Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = game.future_robots[j].isAlive;

                    if (mesto == 1)
                    {
                        Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = 5;
                        fs.WriteLine(mesto.ToString() + "   " + game.future_robots[j].name + " " + "5");
                    }
                    if (mesto > 1 && mesto < 4)
                    {
                        Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = 4;
                        fs.WriteLine(mesto.ToString() + "   " + game.future_robots[j].name + " " + "4");
                    }

                    if (mesto > 3 && mesto < 11)
                    {
                        Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = 3;
                        fs.WriteLine(mesto.ToString() + "   " + game.future_robots[j].name + " " + "3");
                    }

                    if (mesto > 10 && mesto < 21)
                    {
                        Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = 2;
                        fs.WriteLine(mesto.ToString() + "   " + game.future_robots[j].name + " " + "2");
                    }

                    if (mesto > 20 && mesto < 31)
                    {
                        Form3.dataGridView3.Rows[game.future_robots.Count - 1 - j].Cells[i++].Value = 1;
                        fs.WriteLine(mesto.ToString() + "   " + game.future_robots[j].name + " " + "1");
                    }
                }
            }
        }