From a7a04da3c8e7c6647a7f5a52a764465e54b06bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Thu, 29 Sep 2022 21:55:54 +0400 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D0=BC=D0=BE=D0=B1=D0=B8=D0=BB=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B0=D0=BC=D0=BE=D0=BB=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirBomber/AirBomber/FormAirBomber.Designer.cs | 28 +++++++++---------- AirBomber/AirBomber/FormAirBomber.cs | 12 ++++---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/AirBomber/AirBomber/FormAirBomber.Designer.cs b/AirBomber/AirBomber/FormAirBomber.Designer.cs index 910628c..225df8a 100644 --- a/AirBomber/AirBomber/FormAirBomber.Designer.cs +++ b/AirBomber/AirBomber/FormAirBomber.Designer.cs @@ -28,7 +28,7 @@ /// private void InitializeComponent() { - this.pictureBoxCar = new System.Windows.Forms.PictureBox(); + this.pictureBoxAirplane = new System.Windows.Forms.PictureBox(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel(); @@ -38,20 +38,20 @@ this.buttonLeft = new System.Windows.Forms.Button(); this.buttonRight = new System.Windows.Forms.Button(); this.buttonDown = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAirplane)).BeginInit(); this.statusStrip.SuspendLayout(); this.SuspendLayout(); // - // pictureBoxCar + // pictureBoxAirplane // - this.pictureBoxCar.Dock = System.Windows.Forms.DockStyle.Fill; - this.pictureBoxCar.Location = new System.Drawing.Point(0, 0); - this.pictureBoxCar.Name = "pictureBoxCar"; - this.pictureBoxCar.Size = new System.Drawing.Size(800, 428); - this.pictureBoxCar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBoxCar.TabIndex = 0; - this.pictureBoxCar.TabStop = false; - this.pictureBoxCar.Resize += new System.EventHandler(this.PictureBoxCar_Resize); + this.pictureBoxAirplane.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBoxAirplane.Location = new System.Drawing.Point(0, 0); + this.pictureBoxAirplane.Name = "pictureBoxAirplane"; + this.pictureBoxAirplane.Size = new System.Drawing.Size(800, 428); + this.pictureBoxAirplane.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBoxAirplane.TabIndex = 0; + this.pictureBoxAirplane.TabStop = false; + this.pictureBoxAirplane.Resize += new System.EventHandler(this.PictureBoxAirplane_Resize); // // statusStrip // @@ -151,11 +151,11 @@ this.Controls.Add(this.buttonLeft); this.Controls.Add(this.buttonUp); this.Controls.Add(this.buttonCreate); - this.Controls.Add(this.pictureBoxCar); + this.Controls.Add(this.pictureBoxAirplane); this.Controls.Add(this.statusStrip); this.Name = "FormAirBomber"; this.Text = "Самолет"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAirplane)).EndInit(); this.statusStrip.ResumeLayout(false); this.statusStrip.PerformLayout(); this.ResumeLayout(false); @@ -165,7 +165,7 @@ #endregion - private PictureBox pictureBoxCar; + private PictureBox pictureBoxAirplane; private StatusStrip statusStrip; private ToolStripStatusLabel toolStripStatusLabelSpeed; private ToolStripStatusLabel toolStripStatusLabelWeight; diff --git a/AirBomber/AirBomber/FormAirBomber.cs b/AirBomber/AirBomber/FormAirBomber.cs index ecc8bd0..af37ba0 100644 --- a/AirBomber/AirBomber/FormAirBomber.cs +++ b/AirBomber/AirBomber/FormAirBomber.cs @@ -9,14 +9,14 @@ namespace AirBomber InitializeComponent(); } /// - /// Ìåòîä ïðîðèñîâêè ìàøèíû + /// Ìåòîä ïðîðèñîâêè ñàìîëåòà /// private void Draw() { - Bitmap bmp = new(pictureBoxCar.Width, pictureBoxCar.Height); + Bitmap bmp = new(pictureBoxAirplane.Width, pictureBoxAirplane.Height); Graphics gr = Graphics.FromImage(bmp); _airplane?.DrawTransport(gr); - pictureBoxCar.Image = bmp; + pictureBoxAirplane.Image = bmp; } /// /// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü" @@ -28,7 +28,7 @@ namespace AirBomber Random rnd = new(); _airplane = new DrawningAirplane(); _airplane.Init(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256))); - _airplane.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxCar.Width, pictureBoxCar.Height); + _airplane.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxAirplane.Width, pictureBoxAirplane.Height); toolStripStatusLabelSpeed.Text = $"Ñêîðîñòü: {_airplane.Airplane.Speed}"; toolStripStatusLabelWeight.Text = $"Âåñ: {_airplane.Airplane.Weight}"; toolStripStatusLabelBodyColor.Text = $"Öâåò: {_airplane.Airplane.BodyColor.Name}"; @@ -65,9 +65,9 @@ namespace AirBomber /// /// /// - private void PictureBoxCar_Resize(object sender, EventArgs e) + private void PictureBoxAirplane_Resize(object sender, EventArgs e) { - _airplane?.ChangeBorders(pictureBoxCar.Width, pictureBoxCar.Height); + _airplane?.ChangeBorders(pictureBoxAirplane.Width, pictureBoxAirplane.Height); Draw(); } }