public CompaniesList()
 {
     Company company = new Company(100,5,15,50);
     _Companies.Add(company);
     company = new Company(150,5,15,50);
     _Companies.Add(company);
     company = new Company(200,5,15,50);
     _Companies.Add(company);
 }
Exemplo n.º 2
0
 public int IsMonopoly(Company company)
 {
     return 0;
 }
Exemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        private void conrols()
        {
            Label sectorNameLabel = new Label();
            sectorNameLabel.Text = "Промышленность";
            sectorNameLabel.Location = new Point(13, 7);
            sectorNameLabel.BackColor = Color.Gray;
            sectorNameLabel.AutoSize = true;
            this.panel3.Controls.Add(sectorNameLabel);

            List<Company> companies = new List<Company>();
            Company company = new Company(1, "Магазин", 1, 100, 5, 15, 50);
            companies.Add(company);
            company = new Company(2, "Лавка", 1, 150, 5, 15, 50);
            companies.Add(company);
            company = new Company(3, "Ресторан", 1, 200, 5, 15, 50);
            companies.Add(company);

            this.companiesList = companies;

            Panel panel = this.createCompanyPanel(companies[0]);
            panel.Location = new Point(13, 30);
            this.panel3.Controls.Add(panel);
            panel = this.createCompanyPanel(companies[1]);
            panel.Location = new Point(13, 70);
            this.panel3.Controls.Add(panel);
            panel = this.createCompanyPanel(companies[2]);
            panel.Location = new Point(13, 110);
            this.panel3.Controls.Add(panel);
            Panel currentPanel = (Panel)this.panel3.Controls.Find("CompanyName", false).FirstOrDefault();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Создание панели с информацией про организацию, со всеми элементами
        /// Ценой покупки, аренды, налогов и построек плюс принадлежность игроку
        /// </summary>
        /// <param name="company"></param>
        /// <returns></returns>
        private Panel createCompanyPanel(Company company)
        {
            Panel panel = new Panel();
            panel.Name = "CompanyName"/* + company.Id.ToString()*/;
            panel.Height = 30;
            panel.Width = 245;
            panel.AutoSize = true;

            CheckBox nameCheckBox = new CheckBox();
            nameCheckBox.Text = company.Name;
            nameCheckBox.Location = new Point(5, 3);
            nameCheckBox.Width = 90;
            panel.Controls.Add(nameCheckBox);

            TextBox buildings = new TextBox();
            buildings.Location = new Point(100, 5);
            buildings.Width = 20;
            panel.Controls.Add(buildings);

            Label priceList = new Label();
            priceList.Location = new Point(125, 8);
            priceList.Width = 90;

            priceList.Text = company.Price.ToString().PadLeft(4, ' ') + ", " + company.Tax.ToString().PadLeft(4, ' ') + ", "
                + company.Rent.ToString().PadLeft(4, ' ') + ", " + company.BuldingPrice.ToString().PadLeft(4, ' ');
            priceList.AutoSize = true;
            panel.Controls.Add(priceList);

            TextBox player = new TextBox();
            player.Location = new Point(224, 5);
            player.Name = "PlayerTextBox" + company.Id.ToString();
            player.Width = 20;
            panel.Controls.Add(player);

            panel.BackColor = Color.CadetBlue;
            panel.AutoSize = true;
            return panel;
        }