From 5fee344048cb05b245d9e76655a3a8c30a1d552d Mon Sep 17 00:00:00 2001 From: Itos Date: Tue, 14 Nov 2023 00:52:16 +0400 Subject: [PATCH 1/7] =?UTF-8?q?=D0=94=D0=BE=20=D0=BE=D1=82=D0=B2=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GasolineTanker/GasolineTanker/Direction.cs | 16 +++ .../GasolineTanker/DrawningGasolineTanker.cs | 102 ++++++++++++++++++ .../GasolineTanker/EntityGasolineTanker.cs | 38 +++++++ GasolineTanker/GasolineTanker/Form1.resx | 60 +++++++++++ 4 files changed, 216 insertions(+) create mode 100644 GasolineTanker/GasolineTanker/Direction.cs create mode 100644 GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs create mode 100644 GasolineTanker/GasolineTanker/EntityGasolineTanker.cs create mode 100644 GasolineTanker/GasolineTanker/Form1.resx diff --git a/GasolineTanker/GasolineTanker/Direction.cs b/GasolineTanker/GasolineTanker/Direction.cs new file mode 100644 index 0000000..18b1336 --- /dev/null +++ b/GasolineTanker/GasolineTanker/Direction.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GasolineTanker +{ + public enum Direction + { + Up = 1, + Down = 2, + Left = 3, + Right = 4 + } +} diff --git a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs new file mode 100644 index 0000000..0b25d5b --- /dev/null +++ b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GasolineTanker +{ + public class DrawningGasolineTanker + { + public EntityGasolineTanker? EntityGasolineTanker { get; private set; } + public int _pictureWidth; + public int _pictureHeight; + private int _startPosX; + private int _startPosY; + //Ширина грузовика + private readonly int _carWidth = 110; + //Высота грузовика + private readonly int _carHeight = 60; + //Инициализация свойств + public bool Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine, int width, int height) + { + //TODO:Придумать проверки! + _pictureWidth = width; + _pictureHeight = height; + EntityGasolineTanker = new EntityGasolineTanker(); + EntityGasolineTanker.Init(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine); + return true; + } + public void SetPosition(int x, int y) + { + //TODO:Изменение x, y + _startPosX = x; + _startPosY = y; + } + public void MoveTransport(Direction direction) + { + if (EntityGasolineTanker == null) + { + return; + } + switch (direction) + { + case Direction.Left: + if (_startPosX - EntityGasolineTanker.Step > 0) + { + _startPosX -= (int)EntityGasolineTanker.Step; + } + break; + case Direction.Up: + if (_startPosY - EntityGasolineTanker.Step > 0) + { + _startPosY -= (int)EntityGasolineTanker.Step; + } + break; + case Direction.Right: + //TODO:Логика движения + if (_startPosX - EntityGasolineTanker.Step < 1000) + { + _startPosX += (int)EntityGasolineTanker.Step; + } + break; + case Direction.Down: + if (_startPosY - EntityGasolineTanker.Step < 1000) + { + _startPosY += (int)EntityGasolineTanker.Step; + } + break; + } + } + public void DrawTransport(Graphics g) + { + if (EntityGasolineTanker == null) + { + return; + } + Pen pen = new(Color.Black); + Brush additionalBrush = new SolidBrush(EntityGasolineTanker.AdditionalColor); + //Дополнительные элементы + if (EntityGasolineTanker.BodyKit) + { + //обвес + } + //границы автомобиля + g.DrawEllipse(pen, _startPosX + 10, _startPosY + 5, 20, 20); + g.DrawEllipse(pen, _startPosX + 10, _startPosY + 35, 20, 20); + g.DrawEllipse(pen, _startPosX + 80, _startPosY + 5, 20, 20); + g.DrawEllipse(pen, _startPosX + 80, _startPosY + 35, 20, 20); + g.DrawRectangle(pen, _startPosX + 9, _startPosY + 15, 10, 30); + g.DrawRectangle(pen, _startPosX + 90, _startPosY + 15, 10, 30); + g.DrawRectangle(pen, _startPosX + 20, _startPosY + 4, 70, 52); + //задние фары + Brush brRed = new SolidBrush(Color.Red); + g.FillEllipse(brRed, _startPosX + 10, _startPosY + 5, 20, 20); + g.FillEllipse(brRed, _startPosX + 10, _startPosY + 35, 20, 20); + //передние фары + Brush brYellow = new SolidBrush(Color.Yellow); + g.FillEllipse(brYellow, _startPosX + 80, _startPosY + 5, 20, 20); + g.FillEllipse(brYellow, _startPosX + 80, _startPosY + 35, 20, 20); + } + } +} diff --git a/GasolineTanker/GasolineTanker/EntityGasolineTanker.cs b/GasolineTanker/GasolineTanker/EntityGasolineTanker.cs new file mode 100644 index 0000000..63aca0a --- /dev/null +++ b/GasolineTanker/GasolineTanker/EntityGasolineTanker.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Drawing; + +namespace GasolineTanker +{ + public class EntityGasolineTanker + { + public int Speed { get; private set; } + public double Weight { get; private set; } + // Основной цвет + public Color BodyColor { get; private set; } + //Дополнительный цвет + public Color AdditionalColor { get; private set; } + //Наличие обвеса + public bool BodyKit { get; private set; } + //Наличие антикрыла + public bool Wing { get; private set; } + //Наличие гоночной полосы + public bool SportLine { get; private set; } + //Шаг перемещения + public double Step => (double)Speed * 100 / Weight; + //Инициализация полей Грузовика + public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + AdditionalColor = additionalColor; + BodyKit = bodyKit; + Wing = wing; + SportLine = sportLine; + } + } +} diff --git a/GasolineTanker/GasolineTanker/Form1.resx b/GasolineTanker/GasolineTanker/Form1.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/GasolineTanker/GasolineTanker/Form1.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file -- 2.25.1 From 1996b36bc2771d15dfe4ab94cc12c7f591678742 Mon Sep 17 00:00:00 2001 From: Itos Date: Tue, 28 Nov 2023 00:27:15 +0400 Subject: [PATCH 2/7] =?UTF-8?q?=D0=9F=D0=BE=D1=81=D0=BB=D0=B5=D0=B4=D0=BD?= =?UTF-8?q?=D1=8F=D1=8F=20=D0=BF=D0=BE=D0=B4=D0=B3=D0=BE=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=20=D0=BE=D1=87?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B4=D0=BD=D1=8B=D0=BC=20=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D0=BE=D0=BC=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GasolineTanker/DrawningGasolineTanker.cs | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs index 0b25d5b..64b18a4 100644 --- a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs +++ b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs @@ -11,27 +11,40 @@ namespace GasolineTanker public EntityGasolineTanker? EntityGasolineTanker { get; private set; } public int _pictureWidth; public int _pictureHeight; - private int _startPosX; - private int _startPosY; + private int _startPosX = 0; + private int _startPosY = 0; //Ширина грузовика - private readonly int _carWidth = 110; + private readonly int _gasolineTankerWidth = 110; //Высота грузовика - private readonly int _carHeight = 60; + private readonly int _gasolineTankerHeight = 60; //Инициализация свойств public bool Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine, int width, int height) { - //TODO:Придумать проверки! + + if (width <= _gasolineTankerWidth || height <= _gasolineTankerHeight) + { + return false; + } _pictureWidth = width; _pictureHeight = height; EntityGasolineTanker = new EntityGasolineTanker(); + //!!!!!! EntityGasolineTanker.Init(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine); return true; } public void SetPosition(int x, int y) { - //TODO:Изменение x, y + if (EntityGasolineTanker == null) + { + return; + } _startPosX = x; _startPosY = y; + if(x + _gasolineTankerWidth >= _pictureWidth || y + _gasolineTankerHeight >= _pictureHeight) + { + _startPosX = 1; + _startPosY = 1; + } } public void MoveTransport(Direction direction) { @@ -42,29 +55,44 @@ namespace GasolineTanker switch (direction) { case Direction.Left: - if (_startPosX - EntityGasolineTanker.Step > 0) + if (_startPosX - EntityGasolineTanker.Step >= 0) { _startPosX -= (int)EntityGasolineTanker.Step; } + else + { + _startPosX = 0; + } break; case Direction.Up: if (_startPosY - EntityGasolineTanker.Step > 0) { _startPosY -= (int)EntityGasolineTanker.Step; } + else + { + _startPosY = 0; + } break; case Direction.Right: - //TODO:Логика движения - if (_startPosX - EntityGasolineTanker.Step < 1000) + if (_startPosX + EntityGasolineTanker.Step + _gasolineTankerWidth < _pictureWidth) { _startPosX += (int)EntityGasolineTanker.Step; } - break; + else + { + _startPosX = _pictureWidth - _gasolineTankerWidth; + } + break; case Direction.Down: - if (_startPosY - EntityGasolineTanker.Step < 1000) + if (_startPosY + EntityGasolineTanker.Step + _gasolineTankerHeight < _pictureHeight) { _startPosY += (int)EntityGasolineTanker.Step; } + else + { + _startPosY = _pictureHeight - _gasolineTankerHeight; + } break; } } -- 2.25.1 From 33f74074d593388f808386bbc2bacc553f111dab Mon Sep 17 00:00:00 2001 From: Itos Date: Tue, 28 Nov 2023 03:21:03 +0400 Subject: [PATCH 3/7] =?UTF-8?q?=D0=A4=D0=BE=D1=80=D0=BC=D0=B0=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B7=D1=83=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=20=D0=BE=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BA=D0=B0=20=D0=BD=D0=B5=20=D1=81=D1=85=D0=BB=D0=BE?= =?UTF-8?q?=D0=BF=D0=BD=D1=83=D0=BB=D0=B0=D1=81=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GasolineTanker/Form1.Designer.cs | 102 +++++++++++++- GasolineTanker/GasolineTanker/Form1.cs | 4 +- .../GasolineTanker/GasolineTanker.csproj | 15 ++ GasolineTanker/GasolineTanker/Program.cs | 2 +- .../Properties/Resources.Designer.cs | 103 ++++++++++++++ .../GasolineTanker/Properties/Resources.resx | 133 ++++++++++++++++++ .../GasolineTanker/Resources/down.png | Bin 0 -> 4284 bytes .../GasolineTanker/Resources/left.png | Bin 0 -> 4363 bytes .../GasolineTanker/Resources/right.png | Bin 0 -> 1986 bytes .../GasolineTanker/Resources/up.png | Bin 0 -> 4368 bytes 10 files changed, 352 insertions(+), 7 deletions(-) create mode 100644 GasolineTanker/GasolineTanker/Properties/Resources.Designer.cs create mode 100644 GasolineTanker/GasolineTanker/Properties/Resources.resx create mode 100644 GasolineTanker/GasolineTanker/Resources/down.png create mode 100644 GasolineTanker/GasolineTanker/Resources/left.png create mode 100644 GasolineTanker/GasolineTanker/Resources/right.png create mode 100644 GasolineTanker/GasolineTanker/Resources/up.png diff --git a/GasolineTanker/GasolineTanker/Form1.Designer.cs b/GasolineTanker/GasolineTanker/Form1.Designer.cs index 521f5d0..21a3360 100644 --- a/GasolineTanker/GasolineTanker/Form1.Designer.cs +++ b/GasolineTanker/GasolineTanker/Form1.Designer.cs @@ -1,6 +1,6 @@ namespace GasolineTanker { - partial class Form1 + partial class GasolineTanker { /// /// Required designer variable. @@ -28,12 +28,106 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.Window = new System.Windows.Forms.PictureBox(); + this.buttonCreate = new System.Windows.Forms.Button(); + this.buttonRight = new System.Windows.Forms.Button(); + this.buttonDown = new System.Windows.Forms.Button(); + this.buttonLeft = new System.Windows.Forms.Button(); + this.buttonUp = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.Window)).BeginInit(); + this.SuspendLayout(); + // + // Window + // + this.Window.Dock = System.Windows.Forms.DockStyle.Fill; + this.Window.Location = new System.Drawing.Point(0, 0); + this.Window.Name = "Window"; + this.Window.Size = new System.Drawing.Size(884, 461); + this.Window.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.Window.TabIndex = 0; + this.Window.TabStop = false; + // + // buttonCreate + // + this.buttonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCreate.Location = new System.Drawing.Point(12, 426); + this.buttonCreate.Name = "buttonCreate"; + this.buttonCreate.Size = new System.Drawing.Size(75, 23); + this.buttonCreate.TabIndex = 1; + this.buttonCreate.Text = "Создать"; + this.buttonCreate.UseVisualStyleBackColor = true; + // + // buttonRight + // + this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRight.BackgroundImage = global::GasolineTanker.Properties.Resources.right; + this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonRight.Location = new System.Drawing.Point(842, 419); + this.buttonRight.Name = "buttonRight"; + this.buttonRight.Size = new System.Drawing.Size(30, 30); + this.buttonRight.TabIndex = 2; + this.buttonRight.UseVisualStyleBackColor = true; + // + // buttonDown + // + this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDown.BackgroundImage = global::GasolineTanker.Properties.Resources.down; + this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonDown.Location = new System.Drawing.Point(806, 419); + this.buttonDown.Name = "buttonDown"; + this.buttonDown.Size = new System.Drawing.Size(30, 30); + this.buttonDown.TabIndex = 3; + this.buttonDown.UseVisualStyleBackColor = true; + // + // buttonLeft + // + this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonLeft.BackgroundImage = global::GasolineTanker.Properties.Resources.left; + this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonLeft.Location = new System.Drawing.Point(770, 419); + this.buttonLeft.Name = "buttonLeft"; + this.buttonLeft.Size = new System.Drawing.Size(30, 30); + this.buttonLeft.TabIndex = 4; + this.buttonLeft.UseVisualStyleBackColor = true; + // + // buttonUp + // + this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonUp.BackgroundImage = global::GasolineTanker.Properties.Resources.up; + this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonUp.Location = new System.Drawing.Point(806, 383); + this.buttonUp.Name = "buttonUp"; + this.buttonUp.Size = new System.Drawing.Size(30, 30); + this.buttonUp.TabIndex = 5; + this.buttonUp.UseVisualStyleBackColor = true; + // + // GasolineTanker + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; + this.ClientSize = new System.Drawing.Size(884, 461); + this.Controls.Add(this.buttonUp); + this.Controls.Add(this.buttonLeft); + this.Controls.Add(this.buttonDown); + this.Controls.Add(this.buttonRight); + this.Controls.Add(this.buttonCreate); + this.Controls.Add(this.Window); + this.Name = "GasolineTanker"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "GasolineTanker"; + ((System.ComponentModel.ISupportInitialize)(this.Window)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion + + private PictureBox Window; + private Button buttonCreate; + private Button buttonRight; + private Button buttonDown; + private Button buttonLeft; + private Button buttonUp; } } \ No newline at end of file diff --git a/GasolineTanker/GasolineTanker/Form1.cs b/GasolineTanker/GasolineTanker/Form1.cs index da846e9..6825dd1 100644 --- a/GasolineTanker/GasolineTanker/Form1.cs +++ b/GasolineTanker/GasolineTanker/Form1.cs @@ -1,8 +1,8 @@ namespace GasolineTanker { - public partial class Form1 : Form + public partial class GasolineTanker : Form { - public Form1() + public GasolineTanker() { InitializeComponent(); } diff --git a/GasolineTanker/GasolineTanker/GasolineTanker.csproj b/GasolineTanker/GasolineTanker/GasolineTanker.csproj index b57c89e..13ee123 100644 --- a/GasolineTanker/GasolineTanker/GasolineTanker.csproj +++ b/GasolineTanker/GasolineTanker/GasolineTanker.csproj @@ -8,4 +8,19 @@ enable + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/GasolineTanker/GasolineTanker/Program.cs b/GasolineTanker/GasolineTanker/Program.cs index feb86c7..1d3c138 100644 --- a/GasolineTanker/GasolineTanker/Program.cs +++ b/GasolineTanker/GasolineTanker/Program.cs @@ -11,7 +11,7 @@ namespace GasolineTanker // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(new GasolineTanker()); } } } \ No newline at end of file diff --git a/GasolineTanker/GasolineTanker/Properties/Resources.Designer.cs b/GasolineTanker/GasolineTanker/Properties/Resources.Designer.cs new file mode 100644 index 0000000..8d2c2a7 --- /dev/null +++ b/GasolineTanker/GasolineTanker/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace GasolineTanker.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GasolineTanker.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap down { + get { + object obj = ResourceManager.GetObject("down", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap left { + get { + object obj = ResourceManager.GetObject("left", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap right { + get { + object obj = ResourceManager.GetObject("right", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap up { + get { + object obj = ResourceManager.GetObject("up", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/GasolineTanker/GasolineTanker/Properties/Resources.resx b/GasolineTanker/GasolineTanker/Properties/Resources.resx new file mode 100644 index 0000000..53ec0b4 --- /dev/null +++ b/GasolineTanker/GasolineTanker/Properties/Resources.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/GasolineTanker/GasolineTanker/Resources/down.png b/GasolineTanker/GasolineTanker/Resources/down.png new file mode 100644 index 0000000000000000000000000000000000000000..c49c7709fa4e2de813660de37d6b8bc514434dbc GIT binary patch literal 4284 zcmds5Ygkfg*G8hUnh>;fEJej}tTe5(LweaH z_F81^_w!!6dc$fE2(;FRh(8Dd>77}+^j82Y)DNL=fFC{bL2pk`jlfI|2#`pReI6iC z9b?U0=yE__b&hzH3<5#hmM%Sh{I91#AlLyPyvO$`!6SW7m`42G$D!k1C%tj2rTVnS zfOC1v-apM*<`Sa+_>kX|WY715>xj6d6|*Cai?PI?1uf=Z$|?)Gop|5vP4 zZGFxB-fZsgCjl_mgM?BlR`Bq`-wo$4_RwYw{%uE>kN*duC68$)!yH@#0WgC=c)<+v z$loIOFKCu_VrdUQcH}ht??aRJoo{L`{99ZHTe_bm&nT+;-RAXDh2)#1LXRVKN=Qp8 zMWcRInHiF?FgHD*B-e(trcX_G6}vbFx1>&Qvs)N`x7@XZqV{!hImMmme zmRfj?NOts+j8$vGo>^qfY3_;^=5_u2{uAFC%LB4WRZNC9ptG8zlkRX_i0OH7eAaAQ zU0H^>k=F7HMG(WN#g%21;Oraj8R^&kTywxU_9(q|ezNz_V!t&)sVoeNujQWho4a1Q z%Rz$i_FGKt>1?7-d>oJzwAA+?LTKrUh{5QabJw){ThHr82P6*(Xu(dv9bZ}qUmT$n z24THrtr;2HU*E^JfYZiw{TcCwgX99^0mkJ7R`m6t+7Hr%{yNI^r-40Jx0TsBg}I!N zkxJ7`0QG>3OV&`SW9!^KU)COJ#vI*iYI3AE(`3bS`|dMY*N!3 zT1UO^shdeiTLp*g#o+fysiw+&RAfpzPqN={m0)tpk8?q=P6-RygMrH(PlmzoP_~7x zIVv}kM;B6Tv4_gcj`p23+=>Q}7L<3Wm zOmX}gk#DrBe!twzajy9px6n%5ww!tmWrFPLCeX>-sqDAB=>k6~q$l?3UoK!RG zyfL8rMp1$;gfgJHEPHg92!69ifDJ*4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xZG zpd>UziqEzFbl}T&QD`2aa%WuI+m1kGQ3gU%5jJ=&D?EQml&lk7ZZ7_ihYi+eg{Q5# zsT?E4A9At5h0kYvN<6q_c?3`uI!zaPrBOjopOC3u((QGSmGmblXbqcJy`5I|@l9Du8W$LGV#B-pR z497gQhxi}G-=ZcJR>ia^-fd%)?u7rqLKI$#OIn=&IBx~w?6}aH6+q6ebky3!E?Pi} zsAY46z~R_#e6zBOHzJbFz~)Z}5W9pCJ^Nkvy1Dh`7@`rvtUvE&xk@ev!jO9*8|M(@EN=O`PP z-}H#&NFVOd*P1MYr~nPLiKkvXiKJCKb?X>O|DQES9_v>O=5(QuQfzmuBG-uQRu&wY5_ z*qD6z^5r=TvBPKS-lZ!bous9^Ja(9i`Lv{LI3daFr&)vgn!XY|EJD&?uOe9+H8n(F>N;MS%t>`yFvfgJ$onT p7J6!pY5#SHz2@+EfBniDB6-ewd1NR9{DGn7?HPcpIB@Fv{{YeDMjQYD literal 0 HcmV?d00001 diff --git a/GasolineTanker/GasolineTanker/Resources/right.png b/GasolineTanker/GasolineTanker/Resources/right.png new file mode 100644 index 0000000000000000000000000000000000000000..5da511f3e8e20e1181e0316629ed2d876046071d GIT binary patch literal 1986 zcmX|Cc~nzZ9uBez7{CZbqXA1zgdk8yKnVhQm=FR62(p=mbx=d7iY0FBFzhI)#sY?e zzC4gdXpq662m*BhY+3SBh-?L_6o^!y4iOy6G7oL%kMFmi@BHpP_nt4`-fixD2 zH8(f6zP=6sfLt!m%gfu&KB+>wdhuSz6Hq9_XB*JyJS&Mop>&-YR3Pxu@a(A1*%2>e ztw{2fd7Ikv@-3Av8XZgDTP!^t2z$?@6pva@$L?09^ajx zDNR~v96G#$wN34xJhD^WGar@gkk5xB+iYC%U=2YM!(qRR$5loHbK8PESRcV^%bm{sK4xgtnvfeXv{)4j5@AgrurOc z^Xw^b!>QeP!D<9VxZf)P*^HMb9F zqcZcuZ|g0O*3q-)=HxfWb6oBCNoK1!N7F>*!Q-rB;u0+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mGw-C3$x+a zhV2P`M%r7DD?QQr%Mbq-E<~8JkzZx>Bq#T8E!)tlwd*R`GA;e1w*94DHRc^3+#&ik U&6ci$W<*(044N;s)*~|Wf7}GOw*UYD literal 0 HcmV?d00001 diff --git a/GasolineTanker/GasolineTanker/Resources/up.png b/GasolineTanker/GasolineTanker/Resources/up.png new file mode 100644 index 0000000000000000000000000000000000000000..9b45905982bf6973a695755a2ea6b460aa8d8eb9 GIT binary patch literal 4368 zcmeHLX;f3^y2cmOcmUTQJKQfLLsC;I3Z!4?vD1XbT=b z``!E5%)!A_aaMXL~wuW*vz+0yhG*>_!_}Tqm z?$^<&W*aO;t%Lgd7YQL09UVlA_F5w%{}8RCgS;E)yZ@_{h>5=EfLVaa<)|pDM^=YF zX|RR&m3;HlrppdZs`6rcgxB!{&y%l|7auzedxZIQ>P>ts-1yYm+m;Q=m8M-LQ4dYn zMX^igSPxXB=7E9ceQ(8{t4o?uYUb+l?A!0(7KVv?X(JsNe!mT6byj0~IU4@ic3b*- z!WZRhZWx`rT=BnlAM`C}-4~%LZO=dWDHTl9cyYQLuix}qYi%RZ3DkG?Itu$M-KVn2 z*|P(rcXqmCf1(-#DlPu1^?%vwopR;*+o62H@Yi_CM^||8Y1Y4Sq<@~jXJU4-hV1%B zLDqEp!?PsF+cdTl@o(~@b#^{^^;d=JWpBbGh#sx0MoW3m{(th*$0WP5)Bl4&%<`ZM zraO3Pb3|2h=KR#KN_GEGnWg78^~{7!B(92V&QQfAWI#unydi+4!zg199r^A7OB6Wn z)Y80KE{a@~mt|Udb}lIHLuSpX>Ji5tS65f|YQyhKA49xu0Y1`EA5BtqMrNkxO*#Ey zQ>%&_Rt3G9v=bY%tvV+A8y6Rz?rVlXCch+hmItCuG}k`e7SWiwx-w>yt9O3>Zw2hg zqZ#B>mR_R!Y*q8h0(LiX3iYiCyy&Y_o#tElr+7KT2SY1j1IuGiy~A#4BZ!7s zDL&sosD3iTgMQ2>X~~joubLl228nx;rKs0E@S^waCJ?Sz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}lnc1@N`^pVJ8T1!JC(!SpZ>9Iw G-~1;al|GID literal 0 HcmV?d00001 -- 2.25.1 From ede02decf3fe7a35ec980df0011dcb21d05fe7cc Mon Sep 17 00:00:00 2001 From: Itos Date: Tue, 28 Nov 2023 05:21:41 +0400 Subject: [PATCH 4/7] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=8F=D0=B3=D0=B0=20?= =?UTF-8?q?=D0=B1=D0=B5=D0=B7=20=D0=BD=D0=BE=D1=80=D0=BC=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D0=BE=D1=82=D1=80=D0=B8=D1=81=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GasolineTanker/Form1.Designer.cs | 149 +++++++++--------- GasolineTanker/GasolineTanker/Form1.cs | 54 +++++++ 2 files changed, 131 insertions(+), 72 deletions(-) diff --git a/GasolineTanker/GasolineTanker/Form1.Designer.cs b/GasolineTanker/GasolineTanker/Form1.Designer.cs index 21a3360..220fc1f 100644 --- a/GasolineTanker/GasolineTanker/Form1.Designer.cs +++ b/GasolineTanker/GasolineTanker/Form1.Designer.cs @@ -28,94 +28,99 @@ /// private void InitializeComponent() { - this.Window = new System.Windows.Forms.PictureBox(); - this.buttonCreate = new System.Windows.Forms.Button(); - this.buttonRight = new System.Windows.Forms.Button(); - this.buttonDown = new System.Windows.Forms.Button(); - this.buttonLeft = new System.Windows.Forms.Button(); - this.buttonUp = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.Window)).BeginInit(); + this.PictureBoxGasolineTanker = new System.Windows.Forms.PictureBox(); + this.ButtonCreate = new System.Windows.Forms.Button(); + this.ButtonRight = new System.Windows.Forms.Button(); + this.ButtonDown = new System.Windows.Forms.Button(); + this.ButtonLeft = new System.Windows.Forms.Button(); + this.ButtonUp = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.PictureBoxGasolineTanker)).BeginInit(); this.SuspendLayout(); // - // Window + // PictureBoxGasolineTanker // - this.Window.Dock = System.Windows.Forms.DockStyle.Fill; - this.Window.Location = new System.Drawing.Point(0, 0); - this.Window.Name = "Window"; - this.Window.Size = new System.Drawing.Size(884, 461); - this.Window.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.Window.TabIndex = 0; - this.Window.TabStop = false; + this.PictureBoxGasolineTanker.Dock = System.Windows.Forms.DockStyle.Fill; + this.PictureBoxGasolineTanker.Location = new System.Drawing.Point(0, 0); + this.PictureBoxGasolineTanker.Name = "PictureBoxGasolineTanker"; + this.PictureBoxGasolineTanker.Size = new System.Drawing.Size(884, 461); + this.PictureBoxGasolineTanker.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.PictureBoxGasolineTanker.TabIndex = 0; + this.PictureBoxGasolineTanker.TabStop = false; // - // buttonCreate + // ButtonCreate // - this.buttonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonCreate.Location = new System.Drawing.Point(12, 426); - this.buttonCreate.Name = "buttonCreate"; - this.buttonCreate.Size = new System.Drawing.Size(75, 23); - this.buttonCreate.TabIndex = 1; - this.buttonCreate.Text = "Создать"; - this.buttonCreate.UseVisualStyleBackColor = true; + this.ButtonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.ButtonCreate.Location = new System.Drawing.Point(12, 426); + this.ButtonCreate.Name = "ButtonCreate"; + this.ButtonCreate.Size = new System.Drawing.Size(75, 23); + this.ButtonCreate.TabIndex = 1; + this.ButtonCreate.Text = "Создать"; + this.ButtonCreate.UseVisualStyleBackColor = true; + this.ButtonCreate.Click += new System.EventHandler(this.ButtonCreate_Click); // - // buttonRight + // ButtonRight // - this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRight.BackgroundImage = global::GasolineTanker.Properties.Resources.right; - this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.buttonRight.Location = new System.Drawing.Point(842, 419); - this.buttonRight.Name = "buttonRight"; - this.buttonRight.Size = new System.Drawing.Size(30, 30); - this.buttonRight.TabIndex = 2; - this.buttonRight.UseVisualStyleBackColor = true; + this.ButtonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ButtonRight.BackgroundImage = global::GasolineTanker.Properties.Resources.right; + this.ButtonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.ButtonRight.Location = new System.Drawing.Point(842, 419); + this.ButtonRight.Name = "ButtonRight"; + this.ButtonRight.Size = new System.Drawing.Size(30, 30); + this.ButtonRight.TabIndex = 2; + this.ButtonRight.UseVisualStyleBackColor = true; + this.ButtonRight.Click += new System.EventHandler(this.ButtonMove_Click); // - // buttonDown + // ButtonDown // - this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonDown.BackgroundImage = global::GasolineTanker.Properties.Resources.down; - this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.buttonDown.Location = new System.Drawing.Point(806, 419); - this.buttonDown.Name = "buttonDown"; - this.buttonDown.Size = new System.Drawing.Size(30, 30); - this.buttonDown.TabIndex = 3; - this.buttonDown.UseVisualStyleBackColor = true; + this.ButtonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ButtonDown.BackgroundImage = global::GasolineTanker.Properties.Resources.down; + this.ButtonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.ButtonDown.Location = new System.Drawing.Point(806, 419); + this.ButtonDown.Name = "ButtonDown"; + this.ButtonDown.Size = new System.Drawing.Size(30, 30); + this.ButtonDown.TabIndex = 3; + this.ButtonDown.UseVisualStyleBackColor = true; + this.ButtonDown.Click += new System.EventHandler(this.ButtonMove_Click); // - // buttonLeft + // ButtonLeft // - this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLeft.BackgroundImage = global::GasolineTanker.Properties.Resources.left; - this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.buttonLeft.Location = new System.Drawing.Point(770, 419); - this.buttonLeft.Name = "buttonLeft"; - this.buttonLeft.Size = new System.Drawing.Size(30, 30); - this.buttonLeft.TabIndex = 4; - this.buttonLeft.UseVisualStyleBackColor = true; + this.ButtonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ButtonLeft.BackgroundImage = global::GasolineTanker.Properties.Resources.left; + this.ButtonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.ButtonLeft.Location = new System.Drawing.Point(770, 419); + this.ButtonLeft.Name = "ButtonLeft"; + this.ButtonLeft.Size = new System.Drawing.Size(30, 30); + this.ButtonLeft.TabIndex = 4; + this.ButtonLeft.UseVisualStyleBackColor = true; + this.ButtonLeft.Click += new System.EventHandler(this.ButtonMove_Click); // - // buttonUp + // ButtonUp // - this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonUp.BackgroundImage = global::GasolineTanker.Properties.Resources.up; - this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.buttonUp.Location = new System.Drawing.Point(806, 383); - this.buttonUp.Name = "buttonUp"; - this.buttonUp.Size = new System.Drawing.Size(30, 30); - this.buttonUp.TabIndex = 5; - this.buttonUp.UseVisualStyleBackColor = true; + this.ButtonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ButtonUp.BackgroundImage = global::GasolineTanker.Properties.Resources.up; + this.ButtonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.ButtonUp.Location = new System.Drawing.Point(806, 383); + this.ButtonUp.Name = "ButtonUp"; + this.ButtonUp.Size = new System.Drawing.Size(30, 30); + this.ButtonUp.TabIndex = 5; + this.ButtonUp.UseVisualStyleBackColor = true; + this.ButtonUp.Click += new System.EventHandler(this.ButtonMove_Click); // // GasolineTanker // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(884, 461); - this.Controls.Add(this.buttonUp); - this.Controls.Add(this.buttonLeft); - this.Controls.Add(this.buttonDown); - this.Controls.Add(this.buttonRight); - this.Controls.Add(this.buttonCreate); - this.Controls.Add(this.Window); + this.Controls.Add(this.ButtonUp); + this.Controls.Add(this.ButtonLeft); + this.Controls.Add(this.ButtonDown); + this.Controls.Add(this.ButtonRight); + this.Controls.Add(this.ButtonCreate); + this.Controls.Add(this.PictureBoxGasolineTanker); this.Name = "GasolineTanker"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "GasolineTanker"; - ((System.ComponentModel.ISupportInitialize)(this.Window)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PictureBoxGasolineTanker)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -123,11 +128,11 @@ #endregion - private PictureBox Window; - private Button buttonCreate; - private Button buttonRight; - private Button buttonDown; - private Button buttonLeft; - private Button buttonUp; + private PictureBox PictureBoxGasolineTanker; + private Button ButtonCreate; + private Button ButtonRight; + private Button ButtonDown; + private Button ButtonLeft; + private Button ButtonUp; } } \ No newline at end of file diff --git a/GasolineTanker/GasolineTanker/Form1.cs b/GasolineTanker/GasolineTanker/Form1.cs index 6825dd1..dc907fb 100644 --- a/GasolineTanker/GasolineTanker/Form1.cs +++ b/GasolineTanker/GasolineTanker/Form1.cs @@ -2,9 +2,63 @@ namespace GasolineTanker { public partial class GasolineTanker : Form { + private DrawningGasolineTanker? _drawningGasolineTanker; public GasolineTanker() { InitializeComponent(); } + private void Draw() + { + if (_drawningGasolineTanker == null) + return; + + Bitmap bmp = new(PictureBoxGasolineTanker.Width, PictureBoxGasolineTanker.Height); + Graphics gr = Graphics.FromImage(bmp); + _drawningGasolineTanker.DrawTransport(gr); + PictureBoxGasolineTanker.Image = bmp; + } + + private void ButtonCreate_Click(object sender, EventArgs e) + { + Random random = new(); + _drawningGasolineTanker = new DrawningGasolineTanker(); + _drawningGasolineTanker.Init(random.Next(100, 300), + random.Next(1000, 3000), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), + random.Next(0, 256)), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), + random.Next(0, 256)), + Convert.ToBoolean(random.Next(0, 2)), + Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), + PictureBoxGasolineTanker.Width, PictureBoxGasolineTanker.Height); + _drawningGasolineTanker.SetPosition(random.Next(10, 100), + random.Next(10, 100)); + Draw(); + } + private void ButtonMove_Click(object sender, EventArgs e) + { + if (_drawningGasolineTanker == null) + { + return; + } + string name = ((Button)sender)?.Name ?? string.Empty; + switch (name) + { + case "ButtonUp": + _drawningGasolineTanker.MoveTransport(Direction.Up); + break; + case "ButtonDown": + _drawningGasolineTanker.MoveTransport(Direction.Down); + break; + case "ButtonLeft": + _drawningGasolineTanker.MoveTransport(Direction.Left); + break; + case "ButtonRight": + _drawningGasolineTanker.MoveTransport(Direction.Right); + break; + } + Draw(); + } + } } \ No newline at end of file -- 2.25.1 From e4832243932f8e254a6d729f6ec2e8827b8e57a1 Mon Sep 17 00:00:00 2001 From: Itos Date: Tue, 28 Nov 2023 07:45:43 +0400 Subject: [PATCH 5/7] =?UTF-8?q?=D0=9E=D0=B6=D0=B8=D0=B4=D0=B0=D0=B5=D1=82?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=D0=BD=D1=8F=D1=82=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GasolineTanker/DrawningGasolineTanker.cs | 78 +++++++++++++------ .../GasolineTanker/EntityGasolineTanker.cs | 17 ++-- GasolineTanker/GasolineTanker/Form1.cs | 13 ++-- 3 files changed, 69 insertions(+), 39 deletions(-) diff --git a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs index 64b18a4..e30bf9b 100644 --- a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs +++ b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs @@ -14,11 +14,11 @@ namespace GasolineTanker private int _startPosX = 0; private int _startPosY = 0; //Ширина грузовика - private readonly int _gasolineTankerWidth = 110; + private readonly int _gasolineTankerWidth = 200; //Высота грузовика - private readonly int _gasolineTankerHeight = 60; + private readonly int _gasolineTankerHeight = 100; //Инициализация свойств - public bool Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine, int width, int height) + public bool Init(int speed, double weight, Color bodyColor, bool tank, bool signalBeacon, Color additionalColor, int width, int height) { if (width <= _gasolineTankerWidth || height <= _gasolineTankerHeight) @@ -28,8 +28,7 @@ namespace GasolineTanker _pictureWidth = width; _pictureHeight = height; EntityGasolineTanker = new EntityGasolineTanker(); - //!!!!!! - EntityGasolineTanker.Init(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine); + EntityGasolineTanker.Init(speed, weight, bodyColor, tank, signalBeacon, additionalColor); return true; } public void SetPosition(int x, int y) @@ -103,28 +102,61 @@ namespace GasolineTanker return; } Pen pen = new(Color.Black); + Brush bodyBrush = new SolidBrush(EntityGasolineTanker.BodyColor); Brush additionalBrush = new SolidBrush(EntityGasolineTanker.AdditionalColor); + Brush wheelBrush = new SolidBrush(Color.Black); //Дополнительные элементы - if (EntityGasolineTanker.BodyKit) + if (EntityGasolineTanker.Tank) { - //обвес + //Цистерна + g.FillEllipse(additionalBrush, _startPosX + _gasolineTankerWidth / 20 * 3, _startPosY + _gasolineTankerHeight / 10 * 2, _gasolineTankerWidth / 20 * 4, _gasolineTankerHeight / 10 * 4); + g.FillEllipse(additionalBrush, _startPosX + _gasolineTankerWidth / 20 * 9, _startPosY + _gasolineTankerHeight / 10 * 2, _gasolineTankerWidth / 20 * 4, _gasolineTankerHeight / 10 * 4); + Point[] pointsTunk = + { + new Point(_startPosX + _gasolineTankerWidth / 20 * 5, _startPosY + _gasolineTankerHeight / 10 * 2), + new Point(_startPosX + _gasolineTankerWidth / 20 * 11, _startPosY + _gasolineTankerHeight / 10 * 2), + new Point(_startPosX + _gasolineTankerWidth / 20 * 11, _startPosY + _gasolineTankerHeight / 10 * 6), + new Point(_startPosX + _gasolineTankerWidth / 20 * 5, _startPosY + _gasolineTankerHeight / 10 * 6), + }; + g.FillPolygon(additionalBrush, pointsTunk); } - //границы автомобиля - g.DrawEllipse(pen, _startPosX + 10, _startPosY + 5, 20, 20); - g.DrawEllipse(pen, _startPosX + 10, _startPosY + 35, 20, 20); - g.DrawEllipse(pen, _startPosX + 80, _startPosY + 5, 20, 20); - g.DrawEllipse(pen, _startPosX + 80, _startPosY + 35, 20, 20); - g.DrawRectangle(pen, _startPosX + 9, _startPosY + 15, 10, 30); - g.DrawRectangle(pen, _startPosX + 90, _startPosY + 15, 10, 30); - g.DrawRectangle(pen, _startPosX + 20, _startPosY + 4, 70, 52); - //задние фары - Brush brRed = new SolidBrush(Color.Red); - g.FillEllipse(brRed, _startPosX + 10, _startPosY + 5, 20, 20); - g.FillEllipse(brRed, _startPosX + 10, _startPosY + 35, 20, 20); - //передние фары - Brush brYellow = new SolidBrush(Color.Yellow); - g.FillEllipse(brYellow, _startPosX + 80, _startPosY + 5, 20, 20); - g.FillEllipse(brYellow, _startPosX + 80, _startPosY + 35, 20, 20); + if (EntityGasolineTanker.SignalBeacon) + { + //Маячок + Point[] pointsBeacon = + { + new Point(_startPosX + _gasolineTankerWidth / 20 * 14, _startPosY + _gasolineTankerHeight / 10 * 2), + new Point(_startPosX + _gasolineTankerWidth / 20 * 14, _startPosY + _gasolineTankerHeight / 10 * 1), + new Point(_startPosX + _gasolineTankerWidth / 20 * 15, _startPosY + _gasolineTankerHeight / 10 * 1), + new Point(_startPosX + _gasolineTankerWidth / 20 * 15, _startPosY + _gasolineTankerHeight / 10 * 2), + }; + g.FillPolygon(additionalBrush, pointsBeacon); + //g.DrawPolygon(pen, pointsBeacon); + } + /* + //Граница отрисовки объекта + Point[] pointsBorder = { new Point(_startPosX, _startPosY), + new Point(_startPosX, _startPosY + _gasolineTankerHeight), + new Point(_startPosX + _gasolineTankerWidth, _startPosY + _gasolineTankerHeight), + new Point(_startPosX + _gasolineTankerWidth, _startPosY)}; + + g.DrawPolygon(pen, pointsBorder); + */ + Point[] pointsFrame = { + new Point(_startPosX + _gasolineTankerWidth / 20 * 2, _startPosY + _gasolineTankerHeight / 10 * 6), + new Point(_startPosX + _gasolineTankerWidth / 20 * 13, _startPosY + _gasolineTankerHeight / 10 * 6), + new Point(_startPosX + _gasolineTankerWidth / 20 * 13, _startPosY + _gasolineTankerHeight / 10 * 2), + new Point(_startPosX + _gasolineTankerWidth / 20 * 16, _startPosY + _gasolineTankerHeight / 10 * 2), + new Point(_startPosX + _gasolineTankerWidth / 20 * 18, _startPosY + _gasolineTankerHeight / 10 * 5), + new Point(_startPosX + _gasolineTankerWidth / 20 * 18, _startPosY + _gasolineTankerHeight / 10 * 7), + new Point(_startPosX + _gasolineTankerWidth / 20 * 2, _startPosY + _gasolineTankerHeight / 10 * 7),}; + + g.FillPolygon(bodyBrush, pointsFrame); + g.DrawPolygon(pen, pointsFrame); + //Колёса + g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 3, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 2, _gasolineTankerHeight / 10 * 2); + g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 5, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 2, _gasolineTankerHeight / 10 * 2); + g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 15, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 2, _gasolineTankerHeight / 10 * 2); } } } diff --git a/GasolineTanker/GasolineTanker/EntityGasolineTanker.cs b/GasolineTanker/GasolineTanker/EntityGasolineTanker.cs index 63aca0a..bf89b23 100644 --- a/GasolineTanker/GasolineTanker/EntityGasolineTanker.cs +++ b/GasolineTanker/GasolineTanker/EntityGasolineTanker.cs @@ -13,26 +13,23 @@ namespace GasolineTanker public double Weight { get; private set; } // Основной цвет public Color BodyColor { get; private set; } + //Наличие цистерны + public bool Tank { get; private set; } + //Наличие сигнального маяка + public bool SignalBeacon { get; private set; } //Дополнительный цвет public Color AdditionalColor { get; private set; } - //Наличие обвеса - public bool BodyKit { get; private set; } - //Наличие антикрыла - public bool Wing { get; private set; } - //Наличие гоночной полосы - public bool SportLine { get; private set; } //Шаг перемещения public double Step => (double)Speed * 100 / Weight; //Инициализация полей Грузовика - public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine) + public void Init(int speed, double weight, Color bodyColor, bool tank, bool signalBeacon, Color additionalColor) { Speed = speed; Weight = weight; BodyColor = bodyColor; + Tank = tank; + SignalBeacon = signalBeacon; AdditionalColor = additionalColor; - BodyKit = bodyKit; - Wing = wing; - SportLine = sportLine; } } } diff --git a/GasolineTanker/GasolineTanker/Form1.cs b/GasolineTanker/GasolineTanker/Form1.cs index dc907fb..224dafa 100644 --- a/GasolineTanker/GasolineTanker/Form1.cs +++ b/GasolineTanker/GasolineTanker/Form1.cs @@ -20,19 +20,20 @@ namespace GasolineTanker private void ButtonCreate_Click(object sender, EventArgs e) { + Random random = new(); _drawningGasolineTanker = new DrawningGasolineTanker(); - _drawningGasolineTanker.Init(random.Next(100, 300), + _drawningGasolineTanker.Init( + random.Next(100, 300), random.Next(1000, 3000), - Color.FromArgb(random.Next(0, 256), random.Next(0, 256), - random.Next(0, 256)), - Color.FromArgb(random.Next(0, 256), random.Next(0, 256), - random.Next(0, 256)), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), Convert.ToBoolean(random.Next(0, 2)), - Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), + Convert.ToBoolean(random.Next(0, 2)), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), PictureBoxGasolineTanker.Width, PictureBoxGasolineTanker.Height); _drawningGasolineTanker.SetPosition(random.Next(10, 100), random.Next(10, 100)); + Draw(); } private void ButtonMove_Click(object sender, EventArgs e) -- 2.25.1 From 3610d6f7fafc092403593c4fb5ff5857204a650f Mon Sep 17 00:00:00 2001 From: Itos Date: Tue, 28 Nov 2023 13:14:07 +0400 Subject: [PATCH 6/7] =?UTF-8?q?=D0=9C=D0=B0=D1=81=D1=88=D1=82=D0=B0=D0=B1?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D0=B0=D1=8F=20=D0=BE?= =?UTF-8?q?=D1=82=D1=80=D0=B8=D1=81=D0=BE=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GasolineTanker/DrawningGasolineTanker.cs | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs index e30bf9b..8b70eb2 100644 --- a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs +++ b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs @@ -109,14 +109,14 @@ namespace GasolineTanker if (EntityGasolineTanker.Tank) { //Цистерна - g.FillEllipse(additionalBrush, _startPosX + _gasolineTankerWidth / 20 * 3, _startPosY + _gasolineTankerHeight / 10 * 2, _gasolineTankerWidth / 20 * 4, _gasolineTankerHeight / 10 * 4); - g.FillEllipse(additionalBrush, _startPosX + _gasolineTankerWidth / 20 * 9, _startPosY + _gasolineTankerHeight / 10 * 2, _gasolineTankerWidth / 20 * 4, _gasolineTankerHeight / 10 * 4); + g.FillEllipse(additionalBrush, _startPosX + _gasolineTankerWidth / 20 * 0, _startPosY + _gasolineTankerHeight / 10 * 1, _gasolineTankerWidth / 20 * 5, _gasolineTankerHeight / 10 * 5); + g.FillEllipse(additionalBrush, _startPosX + _gasolineTankerWidth / 20 * 7, _startPosY + _gasolineTankerHeight / 10 * 1, _gasolineTankerWidth / 20 * 5, _gasolineTankerHeight / 10 * 5); Point[] pointsTunk = { - new Point(_startPosX + _gasolineTankerWidth / 20 * 5, _startPosY + _gasolineTankerHeight / 10 * 2), - new Point(_startPosX + _gasolineTankerWidth / 20 * 11, _startPosY + _gasolineTankerHeight / 10 * 2), - new Point(_startPosX + _gasolineTankerWidth / 20 * 11, _startPosY + _gasolineTankerHeight / 10 * 6), - new Point(_startPosX + _gasolineTankerWidth / 20 * 5, _startPosY + _gasolineTankerHeight / 10 * 6), + new Point(_startPosX + _gasolineTankerWidth / 20 * 2, _startPosY + _gasolineTankerHeight / 10 * 1), + new Point(_startPosX + _gasolineTankerWidth / 20 * 9, _startPosY + _gasolineTankerHeight / 10 * 1), + new Point(_startPosX + _gasolineTankerWidth / 20 * 9, _startPosY + _gasolineTankerHeight / 10 * 6), + new Point(_startPosX + _gasolineTankerWidth / 20 * 2, _startPosY + _gasolineTankerHeight / 10 * 6), }; g.FillPolygon(additionalBrush, pointsTunk); } @@ -125,10 +125,10 @@ namespace GasolineTanker //Маячок Point[] pointsBeacon = { - new Point(_startPosX + _gasolineTankerWidth / 20 * 14, _startPosY + _gasolineTankerHeight / 10 * 2), + new Point(_startPosX + _gasolineTankerWidth / 20 * 13, _startPosY + _gasolineTankerHeight / 10 * 1), + new Point(_startPosX + _gasolineTankerWidth / 20 * 13, _startPosY + _gasolineTankerHeight / 10 * 0), + new Point(_startPosX + _gasolineTankerWidth / 20 * 14, _startPosY + _gasolineTankerHeight / 10 * 0), new Point(_startPosX + _gasolineTankerWidth / 20 * 14, _startPosY + _gasolineTankerHeight / 10 * 1), - new Point(_startPosX + _gasolineTankerWidth / 20 * 15, _startPosY + _gasolineTankerHeight / 10 * 1), - new Point(_startPosX + _gasolineTankerWidth / 20 * 15, _startPosY + _gasolineTankerHeight / 10 * 2), }; g.FillPolygon(additionalBrush, pointsBeacon); //g.DrawPolygon(pen, pointsBeacon); @@ -142,21 +142,22 @@ namespace GasolineTanker g.DrawPolygon(pen, pointsBorder); */ - Point[] pointsFrame = { - new Point(_startPosX + _gasolineTankerWidth / 20 * 2, _startPosY + _gasolineTankerHeight / 10 * 6), - new Point(_startPosX + _gasolineTankerWidth / 20 * 13, _startPosY + _gasolineTankerHeight / 10 * 6), - new Point(_startPosX + _gasolineTankerWidth / 20 * 13, _startPosY + _gasolineTankerHeight / 10 * 2), - new Point(_startPosX + _gasolineTankerWidth / 20 * 16, _startPosY + _gasolineTankerHeight / 10 * 2), - new Point(_startPosX + _gasolineTankerWidth / 20 * 18, _startPosY + _gasolineTankerHeight / 10 * 5), - new Point(_startPosX + _gasolineTankerWidth / 20 * 18, _startPosY + _gasolineTankerHeight / 10 * 7), - new Point(_startPosX + _gasolineTankerWidth / 20 * 2, _startPosY + _gasolineTankerHeight / 10 * 7),}; - + Point[] pointsFrame = { + new Point(_startPosX + _gasolineTankerWidth / 20 * 0, _startPosY + _gasolineTankerHeight / 10 * 6), + new Point(_startPosX + _gasolineTankerWidth / 20 * 12, _startPosY + _gasolineTankerHeight / 10 * 6), + new Point(_startPosX + _gasolineTankerWidth / 20 * 12, _startPosY + _gasolineTankerHeight / 10 * 1), + new Point(_startPosX + _gasolineTankerWidth / 20 * 15, _startPosY + _gasolineTankerHeight / 10 * 1), + new Point(_startPosX + _gasolineTankerWidth / 20 * 16, _startPosY + _gasolineTankerHeight / 10 * 4), + new Point(_startPosX + _gasolineTankerWidth / 20 * 20, _startPosY + _gasolineTankerHeight / 10 * 5), + new Point(_startPosX + _gasolineTankerWidth / 20 * 20, _startPosY + _gasolineTankerHeight / 10 * 8), + new Point(_startPosX + _gasolineTankerWidth / 20 * 0, _startPosY + _gasolineTankerHeight / 10 * 8),}; + g.FillPolygon(bodyBrush, pointsFrame); g.DrawPolygon(pen, pointsFrame); //Колёса - g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 3, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 2, _gasolineTankerHeight / 10 * 2); - g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 5, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 2, _gasolineTankerHeight / 10 * 2); - g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 15, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 2, _gasolineTankerHeight / 10 * 2); + g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 1, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 3, _gasolineTankerHeight / 10 * 3); + g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 5, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 3, _gasolineTankerHeight / 10 * 3); + g.FillEllipse(wheelBrush, _startPosX + _gasolineTankerWidth / 20 * 16, _startPosY + _gasolineTankerHeight / 10 * 7, _gasolineTankerWidth / 20 * 3, _gasolineTankerHeight / 10 * 3); } } } -- 2.25.1 From 9346511d94ff18858d75d06c04885bc36c3dd310 Mon Sep 17 00:00:00 2001 From: Itos Date: Tue, 12 Dec 2023 03:52:44 +0400 Subject: [PATCH 7/7] =?UTF-8?q?Lab1=20=D0=97=D0=B0=D0=B2=D0=B5=D1=80=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs index 8b70eb2..674604f 100644 --- a/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs +++ b/GasolineTanker/GasolineTanker/DrawningGasolineTanker.cs @@ -134,7 +134,7 @@ namespace GasolineTanker //g.DrawPolygon(pen, pointsBeacon); } /* - //Граница отрисовки объекта + //Граница отрисовки объекта(для безопасности при редактировании) Point[] pointsBorder = { new Point(_startPosX, _startPosY), new Point(_startPosX, _startPosY + _gasolineTankerHeight), new Point(_startPosX + _gasolineTankerWidth, _startPosY + _gasolineTankerHeight), -- 2.25.1