示例#1
0
    private void CalculateYield()
    {
        List <Item> tempYield = new List <Item>();

        if (growthStatus > 1)
        {
            tempYield.Add(Seed);
        }
        if (growthStatus > 2)
        {
            tempYield.Add(Seed);
            land test = new land();
        }
    }
示例#2
0
        //запись данных в БД
        private void button1_Click(object sender, EventArgs e)
        {
            @base @base;

            if (radioButton1.Checked == true)
            {
                house house = new house(
                    maskedTextBox1.Text, maskedTextBox2.Text,
                    (int)numericUpDown3.Value, 0, (int)numericUpDown1.Value, (int)numericUpDown2.Value, (int)numericUpDown4.Value, (int)numericUpDown5.Value, (int)numericUpDown6.Value);
                @base = new @base(
                    "insert into house(etag, rooms, s) values(" + house.get_etag() + ", " + house.get_rooms() + ", " + house.get_s() + ") " +
                    "declare @id int " +
                    "select @id = MAX(Id) from house " +
                    "insert into obj (city, street, nm_h, x, y, dop_inf) values(N'" + house.get_city() + "', N'" + house.get_street() + "', " + house.get_nm_h() + ", " + house.get_x() + ", " + house.get_y() + ", @id)");
                @base.zapis_v_bd();
                MessageBox.Show("Данные записанны");
            }
            else if (radioButton2.Checked == true)
            {
                kw kw = new kw(
                    maskedTextBox4.Text, maskedTextBox3.Text, (int)numericUpDown10.Value,
                    (int)numericUpDown11.Value, (int)numericUpDown1.Value, (int)numericUpDown2.Value, (int)numericUpDown9.Value, (int)numericUpDown8.Value, (int)numericUpDown7.Value);
                @base = new @base(
                    "insert into kw(etag, rooms, s) values (" + kw.get_etag() + ", " + kw.get_rooms() + ", " + kw.get_s() + ") " +
                    "declare @id int " +
                    "select @id=MAX(Id) from kw " +
                    "insert into obj (city, street, nm_kw, nm_h, x, y, dop_inf) values (N'" + kw.get_city() + "', N'" + kw.get_street() + "', " + kw.get_nm_kw() + ", " + kw.get_nm_h() + ", " + kw.get_x() + ", " + kw.get_y() + ", @id)");
                @base.zapis_v_bd();
                MessageBox.Show("Данные записанны");
            }
            else if (radioButton3.Checked == true)
            {
                land land = new land(maskedTextBox6.Text, maskedTextBox5.Text, 0, 0, (int)numericUpDown1.Value, (int)numericUpDown2.Value, (int)numericUpDown13.Value);
                @base = new @base("insert into land(s) values (" + land.get_s() + ") declare @id int select @id=MAX(Id) from land insert into obj (city, street, x, y, dop_inf) values (N'" + land.get_city() + "', N'" + land.get_street() + "', " + land.get_x() + ", " + land.get_y() + ", @id)");
                @base.zapis_v_bd();
                MessageBox.Show("Данные записанны");
            }
            else
            {
                MessageBox.Show("Выберите тип недвижимости", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#3
0
        private List <land> ConnectionOfARow(int[] A, int k)
        {
            var results = new List <land>();

            for (int i = 0; i < A.Length; i++)
            {
                if (A[i] == k)
                {
                    var land = new land {
                        edge_left = i, size = 1
                    };
                    while (A[i] == k)
                    {
                        land.size++;
                        i++;
                    }
                    land.edge_right = i;
                    results.Add(land);
                }
            }
            return(results);
        }
示例#4
0
 void Start()
 {
     heroHorse.name = "plotwa";
     territory      = land.north;
     StartCoroutine("Enemies");
 }