From 147b7ab733aae4b338a04389a770956a2d4c5a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=BD=D0=B0=20=D0=92=D0=B0=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0?= Date: Mon, 2 Oct 2023 21:09:15 +0400 Subject: [PATCH 1/3] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DumpTruck/DumpTruck/Form1.Designer.cs | 22 +++++++++- DumpTruck/DumpTruck/Form1.resx | 62 +-------------------------- 2 files changed, 22 insertions(+), 62 deletions(-) diff --git a/DumpTruck/DumpTruck/Form1.Designer.cs b/DumpTruck/DumpTruck/Form1.Designer.cs index 073cfce..837f3a1 100644 --- a/DumpTruck/DumpTruck/Form1.Designer.cs +++ b/DumpTruck/DumpTruck/Form1.Designer.cs @@ -28,12 +28,32 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.button1 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(292, 97); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(283, 192); + this.button1.TabIndex = 0; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.button1); + this.Name = "Form1"; this.Text = "Form1"; + this.ResumeLayout(false); + } #endregion + + private Button button1; } } \ No newline at end of file diff --git a/DumpTruck/DumpTruck/Form1.resx b/DumpTruck/DumpTruck/Form1.resx index 1af7de1..f298a7b 100644 --- a/DumpTruck/DumpTruck/Form1.resx +++ b/DumpTruck/DumpTruck/Form1.resx @@ -1,64 +1,4 @@ - - - + -- 2.25.1 From ada566ea90011d506d38d49bf67da473eda8c39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=BD=D0=B0=20=D0=92=D0=B0=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0?= Date: Tue, 3 Oct 2023 11:59:36 +0400 Subject: [PATCH 2/3] result --- DumpTruck/DumpTruck/Direction.cs | 30 ++++ DumpTruck/DumpTruck/DrawingDumpCar.cs | 147 ++++++++++++++++++ DumpTruck/DumpTruck/DumpTruck.cs | 65 ++++++++ DumpTruck/DumpTruck/DumpTruck.csproj | 15 ++ DumpTruck/DumpTruck/Form1.Designer.cs | 99 +++++++++++- DumpTruck/DumpTruck/Form1.cs | 61 +++++++- DumpTruck/DumpTruck/Program.cs | 2 +- .../Properties/Resources.Designer.cs | 103 ++++++++++++ DumpTruck/DumpTruck/Properties/Resources.resx | 133 ++++++++++++++++ DumpTruck/DumpTruck/Resources/down.png | Bin 0 -> 3877 bytes DumpTruck/DumpTruck/Resources/left.png | Bin 0 -> 2763 bytes DumpTruck/DumpTruck/Resources/right.png | Bin 0 -> 2284 bytes DumpTruck/DumpTruck/Resources/up.png | Bin 0 -> 3961 bytes 13 files changed, 647 insertions(+), 8 deletions(-) create mode 100644 DumpTruck/DumpTruck/Direction.cs create mode 100644 DumpTruck/DumpTruck/DrawingDumpCar.cs create mode 100644 DumpTruck/DumpTruck/DumpTruck.cs create mode 100644 DumpTruck/DumpTruck/Properties/Resources.Designer.cs create mode 100644 DumpTruck/DumpTruck/Properties/Resources.resx create mode 100644 DumpTruck/DumpTruck/Resources/down.png create mode 100644 DumpTruck/DumpTruck/Resources/left.png create mode 100644 DumpTruck/DumpTruck/Resources/right.png create mode 100644 DumpTruck/DumpTruck/Resources/up.png diff --git a/DumpTruck/DumpTruck/Direction.cs b/DumpTruck/DumpTruck/Direction.cs new file mode 100644 index 0000000..1d82081 --- /dev/null +++ b/DumpTruck/DumpTruck/Direction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DumpTruck +{ + public enum DirectionType + { + /// + /// Вверх + /// + Up = 1, + /// + /// Вниз + /// + Down = 2, + /// + /// Влево + /// + Left = 3, + /// + /// Вправо + /// + Right = 4 + } +} + + diff --git a/DumpTruck/DumpTruck/DrawingDumpCar.cs b/DumpTruck/DumpTruck/DrawingDumpCar.cs new file mode 100644 index 0000000..8e19495 --- /dev/null +++ b/DumpTruck/DumpTruck/DrawingDumpCar.cs @@ -0,0 +1,147 @@ +using DumpTruck; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DumpTruck +{ + public class DrawningDumpTruck + { + public DumpTruck EntityDumpTruck { get; private set; } + + private int _pictureWidth; + + private 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 tent, int width, int height) + { + _pictureWidth = width; + _pictureHeight = height; + if (_pictureWidth > _carWidth && _pictureHeight > _carHeight) + { + + EntityDumpTruck = new DumpTruck(); + EntityDumpTruck.Init(speed, weight, bodyColor, additionalColor, bodyKit, tent); + return true; + } + return false; + } + + public void SetPosition(int x, int y) + { + if (x < 0 || x >= _pictureWidth || y < 0 || y >= _pictureHeight) + { + _startPosX = 0; + _startPosY = 0; + } + _startPosX = x; + _startPosY = y; + } + public void MoveTransport(DirectionType direction) + { + if (EntityDumpTruck == null) + { + + return; + } + switch (direction) + { + //влево + case DirectionType.Left: + if (_startPosX - EntityDumpTruck.Step > 0) + { + _startPosX -= (int)EntityDumpTruck.Step; + } + break; + //вверх + case DirectionType.Up: + + if (_startPosY - EntityDumpTruck.Step > 0) + { + _startPosY -= (int)EntityDumpTruck.Step; + } + break; + // вправо + case DirectionType.Right: + if (_startPosX + EntityDumpTruck.Step + _carWidth < _pictureWidth) + { + _startPosX += (int)EntityDumpTruck.Step; + + } + break; + //вниз + case DirectionType.Down: + + if (_startPosY + EntityDumpTruck.Step + _carHeight < _pictureHeight) + { + _startPosY += (int)EntityDumpTruck.Step; + } + break; + } + } + public void DrawTransport(Graphics g) + { + if (EntityDumpTruck == null) + { + return; + } + + Pen pen = new Pen(Color.Black); + Brush brush = new SolidBrush(EntityDumpTruck.BodyColor); + Brush addBrush = new SolidBrush(EntityDumpTruck.AdditionalColor); + + //границы автомобиля + g.FillRectangle(brush, _startPosX, _startPosY + 35, 110, 10); + g.FillRectangle(brush, _startPosX + 85, _startPosY, 25, 35); + g.FillEllipse(brush, _startPosX, _startPosY + 35 + 10, 15, 15); + g.FillEllipse(brush, _startPosX + 15, _startPosY + 35 + 10, 15, 15); + g.FillEllipse(brush, _startPosX + 95, _startPosY + 35 + 10, 15, 15); + + if (EntityDumpTruck.Tent) + { + Point[] points = new Point[3]; + points[0].X = _startPosX; points[0].Y = _startPosY + 35; + points[1].X = _startPosX + 85; points[1].Y = _startPosY; + points[2].X = _startPosX + 85; points[2].Y = _startPosY + 35; + g.FillPolygon(addBrush, points); + } + + if (EntityDumpTruck.BodyKit) + { + Point[] points = new Point[4]; + points[0].X = _startPosX; points[0].Y = _startPosY + 35; + points[1].X = _startPosX; points[1].Y = _startPosY; + points[2].X = _startPosX + 85; points[2].Y = _startPosY; + points[3].X = _startPosX + 85; points[3].Y = _startPosY + 35; + g.FillPolygon(addBrush, points); + } + + if (EntityDumpTruck.BodyKit && EntityDumpTruck.Tent) + { + int x = _startPosX; + int y = _startPosY - 8; + g.FillRectangle(brush, _startPosX, _startPosY, 95, 3); + for (int i = 0; i < 6; i++) + { + Rectangle smallRect = new Rectangle(x, y, 15, 15); + g.FillPie(brush, smallRect, 0, 180); + x += 15; + } + } + } + } +} + + diff --git a/DumpTruck/DumpTruck/DumpTruck.cs b/DumpTruck/DumpTruck/DumpTruck.cs new file mode 100644 index 0000000..ed21ad2 --- /dev/null +++ b/DumpTruck/DumpTruck/DumpTruck.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Net.NetworkInformation; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace DumpTruck +{ + public class DumpTruck + { + + /// + /// Скорость + /// + 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; } + + /// + /// Признак (опция) наличия tent + /// + public bool Tent { get; private set; } + + /// + /// Шаг перемещения автомобиля + /// + public double Step => (double)Speed * 100 / Weight; + public void Init(int speed, double weight, Color bodyColor, Color + additionalColor, bool bodyKit, bool tent) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + AdditionalColor = additionalColor; + BodyKit = bodyKit; + Tent = tent; + } + } + +} + + + + diff --git a/DumpTruck/DumpTruck/DumpTruck.csproj b/DumpTruck/DumpTruck/DumpTruck.csproj index b57c89e..13ee123 100644 --- a/DumpTruck/DumpTruck/DumpTruck.csproj +++ b/DumpTruck/DumpTruck/DumpTruck.csproj @@ -8,4 +8,19 @@ enable + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/DumpTruck/DumpTruck/Form1.Designer.cs b/DumpTruck/DumpTruck/Form1.Designer.cs index 837f3a1..6049a5c 100644 --- a/DumpTruck/DumpTruck/Form1.Designer.cs +++ b/DumpTruck/DumpTruck/Form1.Designer.cs @@ -1,6 +1,6 @@ namespace DumpTruck { - partial class Form1 + partial class FormDumpTruck { /// /// Required designer variable. @@ -29,6 +29,13 @@ private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); + this.pictureBox = new System.Windows.Forms.PictureBox(); + this.button = new System.Windows.Forms.Button(); + this.buttonDown = new System.Windows.Forms.Button(); + this.buttonUp = new System.Windows.Forms.Button(); + this.buttonRight = new System.Windows.Forms.Button(); + this.buttonLeft = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.SuspendLayout(); // // button1 @@ -40,20 +47,104 @@ this.button1.Text = "button1"; this.button1.UseVisualStyleBackColor = true; // - // Form1 + // pictureBox + // + this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox.Location = new System.Drawing.Point(0, 0); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(884, 461); + this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox.TabIndex = 1; + this.pictureBox.TabStop = false; + // + // button + // + this.button.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.button.Location = new System.Drawing.Point(283, 385); + this.button.Name = "button"; + this.button.Size = new System.Drawing.Size(225, 39); + this.button.TabIndex = 2; + this.button.Text = "Добавить"; + this.button.UseVisualStyleBackColor = true; + this.button.Click += new System.EventHandler(this.button_Click); + // + // buttonDown + // + this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDown.BackgroundImage = global::DumpTruck.Properties.Resources.down; + this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonDown.Location = new System.Drawing.Point(721, 367); + this.buttonDown.Name = "buttonDown"; + this.buttonDown.Size = new System.Drawing.Size(59, 57); + this.buttonDown.TabIndex = 3; + this.buttonDown.UseVisualStyleBackColor = true; + this.buttonDown.Click += new System.EventHandler(this.buttonMove_Click); + // + // buttonUp + // + this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonUp.BackgroundImage = global::DumpTruck.Properties.Resources.up; + this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonUp.Location = new System.Drawing.Point(721, 304); + this.buttonUp.Name = "buttonUp"; + this.buttonUp.Size = new System.Drawing.Size(59, 57); + this.buttonUp.TabIndex = 4; + this.buttonUp.UseVisualStyleBackColor = true; + this.buttonUp.Click += new System.EventHandler(this.buttonMove_Click); + // + // buttonRight + // + this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRight.BackgroundImage = global::DumpTruck.Properties.Resources.right; + this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonRight.Location = new System.Drawing.Point(786, 367); + this.buttonRight.Name = "buttonRight"; + this.buttonRight.Size = new System.Drawing.Size(59, 57); + this.buttonRight.TabIndex = 5; + this.buttonRight.UseVisualStyleBackColor = true; + this.buttonRight.Click += new System.EventHandler(this.buttonMove_Click); + // + // buttonLeft + // + this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonLeft.BackgroundImage = global::DumpTruck.Properties.Resources.left; + this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonLeft.Location = new System.Drawing.Point(656, 367); + this.buttonLeft.Name = "buttonLeft"; + this.buttonLeft.Size = new System.Drawing.Size(59, 57); + this.buttonLeft.TabIndex = 6; + this.buttonLeft.UseVisualStyleBackColor = true; + this.buttonLeft.Click += new System.EventHandler(this.buttonMove_Click); + // + // FormDumpTruck // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(884, 461); + this.Controls.Add(this.buttonLeft); + this.Controls.Add(this.buttonRight); + this.Controls.Add(this.buttonUp); + this.Controls.Add(this.buttonDown); + this.Controls.Add(this.button); + this.Controls.Add(this.pictureBox); this.Controls.Add(this.button1); - this.Name = "Form1"; + this.Name = "FormDumpTruck"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion private Button button1; + private PictureBox pictureBox; + private Button button; + private Button buttonDown; + private Button buttonUp; + private Button buttonRight; + private Button buttonLeft; } } \ No newline at end of file diff --git a/DumpTruck/DumpTruck/Form1.cs b/DumpTruck/DumpTruck/Form1.cs index 2326120..4bb395e 100644 --- a/DumpTruck/DumpTruck/Form1.cs +++ b/DumpTruck/DumpTruck/Form1.cs @@ -1,10 +1,65 @@ namespace DumpTruck { - public partial class Form1 : Form + public partial class FormDumpTruck : Form { - public Form1() + public FormDumpTruck() { InitializeComponent(); } + + private void button_Click(object sender, EventArgs e) + { + Random random = new Random(); + _drawningDumpTruck = new DrawningDumpTruck(); + _drawningDumpTruck.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)), + pictureBox.Width, pictureBox.Height); + _drawningDumpTruck.SetPosition(random.Next(10, 100), + random.Next(10, 100)); + Draw(); + } + + private DrawningDumpTruck _drawningDumpTruck; + private void Draw() + { + if (_drawningDumpTruck == null) + { + return; + } + Bitmap bmp = new Bitmap(pictureBox.Width, pictureBox.Height); + Graphics gr = Graphics.FromImage(bmp); + _drawningDumpTruck.DrawTransport(gr); + pictureBox.Image = bmp; + } + + private void buttonMove_Click(object sender, EventArgs e) + { + if (_drawningDumpTruck == null) + { + return; + } + string name = ((Button)sender)?.Name ?? string.Empty; + switch (name) + { + case "buttonUp": + _drawningDumpTruck.MoveTransport(DirectionType.Up); + break; + case "buttonDown": + _drawningDumpTruck.MoveTransport(DirectionType.Down); + break; + case "buttonLeft": + _drawningDumpTruck.MoveTransport(DirectionType.Left); + break; + case "buttonRight": + _drawningDumpTruck.MoveTransport(DirectionType.Right); + break; + } + Draw(); + } + } -} \ No newline at end of file +} diff --git a/DumpTruck/DumpTruck/Program.cs b/DumpTruck/DumpTruck/Program.cs index a716913..b619d5a 100644 --- a/DumpTruck/DumpTruck/Program.cs +++ b/DumpTruck/DumpTruck/Program.cs @@ -11,7 +11,7 @@ namespace DumpTruck // 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 FormDumpTruck()); } } } \ No newline at end of file diff --git a/DumpTruck/DumpTruck/Properties/Resources.Designer.cs b/DumpTruck/DumpTruck/Properties/Resources.Designer.cs new file mode 100644 index 0000000..aac7e60 --- /dev/null +++ b/DumpTruck/DumpTruck/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace DumpTruck.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("DumpTruck.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/DumpTruck/DumpTruck/Properties/Resources.resx b/DumpTruck/DumpTruck/Properties/Resources.resx new file mode 100644 index 0000000..53ec0b4 --- /dev/null +++ b/DumpTruck/DumpTruck/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/DumpTruck/DumpTruck/Resources/down.png b/DumpTruck/DumpTruck/Resources/down.png new file mode 100644 index 0000000000000000000000000000000000000000..b86d23bb5dce63027f686afbb4a52458244fc89f GIT binary patch literal 3877 zcmeH~hg(zE8^_PR1PnulSf&hD3rfLO1q)OnBE!X01T3Sdkr6;ilOWPus|bpSwE`+r zhGJMjmdvCIf>^*&OCSWO3=wX^(lF8_J^mZNU!UjR=jMLT=X~FB-sE|5#pAHcY83+& z0KjTDS0^t3Q1}rAL^^y7>@^ME>9IBk&c8^>T3p6+P=dz!w5}&!Ig4 zRHdo@6QT&$COi)M?32so#->L9UH{u1n6)S#fD>?!>UG!~AgBUCQE3%XSw(fVx`w9K znzcH*disV&ChIqtZ?Ul2X0yxQf#mFV(EW(7UqDdEkD;f-BPp?rxbxVBUoKusyquJL z8dtSbN`&a(}e^4+qJUTYe|JfNOHHB|Byy!GLVNr$J24pzX>LyQwd3ic{8gJQXm{j1_>G6INb^hJ=UH~u}o-5|lxq~@*f$5M*;o7CnkU+F0Gp+ifz z`pXi&%*OEi5&1xv%jq`3YVJJeD>S-4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{R zib+S0ctNl%8-jl35Ul+cf>E0xI5rPK-uP$m#nzE}+@v)d z%VWCMW6~s_a|rHG<^?z0OFs%E8kM&onq2%DwMd6(c-Uw3z-RP06QcNv3Pk(dAYn9g-D|pT)O_fF!Nb5|YVthIW&zBLQ@8x_S!jj zjU=t1e|QyJ{y1y%2tkt8`~jl>9D-IVlz>MKzMmq*nWx`eaxnbZ86gCz%?(oP<*TAQ z)oEe>bXyHfWd>x|r@0miRCOa)d>h$pe(OP7iXb*-?qiBoZlL{R7qNyspk5@OB#jy+ Unw8DM{{_Hp-(jZ;$KYT71(4tLOaK4? literal 0 HcmV?d00001 diff --git a/DumpTruck/DumpTruck/Resources/left.png b/DumpTruck/DumpTruck/Resources/left.png new file mode 100644 index 0000000000000000000000000000000000000000..fe6ec66f0fd8429cb4ac725f5ce02d399ea9cd32 GIT binary patch literal 2763 zcmeHIc~nzp7JmsMn>cn(8)OM8)^?_#)-Euz7@+KmD0`$K>`McL3N$Qb9$G7d1rZd{ zB1G0Ggk1=PC2B`OME1oPOrR zBO$Wc6lv#f2SJUwI;+9z$l2_%Bi@bx0OOtb|KI=H6Ie8>e1d!drHP(Ly&w!$ZIk+D z4NWa=9o?;e+V<9;-^S@}*EhuP*k$t956t#|Xz@2|f~}M55f2|fVgNZfBsA)anAn8m zl&>>Ro&M&`w`Vi|k#+97?40wt7xMBiUMjd;c;)K%Mc0Z;=+{fj$}1|X7&mTK*D!1A z>KhuHns2qVve+G6-JIKZ?)CIO=zG}zXkch$e1iLgH}#Y+c=mi&C=$P1SbX*Kl4N=1 zwM?#1&Pwk%A!4=SU5E(~G^2w)n7GovTtSlhiH`n>Uet(0TJXtmh(@FBi;kltga*fl z@1vfKEc%zV0R(B}xH{N*CkM_y<*^FF_3zJUZ9iLfxG6i^vti6FmP$0>^2>@Vqr>$b zZ^rg-IgoY9Y!5HbGt6*N?(x~zoA-PaG(gMV+Wk{^U3vSgtfX8}+l130BHV9q6*Eb+ zm2SrQL-5>iT3p*LzD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!@tPxtf1M9xC|J$kvZ zm0Mf+_vL^un|qZkSI|wfuYUO4zG}*-PG+pmC@{Shz5wAJA!LgqoXWeoHB~iHqS2_T z>Ih>uU|v5On0V2LIYkH%zl*i<)pe7Z?#BXVsv}k+yZ~W|q<*AU@{4*_Om1X#LAAf| zb>Xq0z0uoj^TGO>lrIIPY>co?4OyTcwR&3SUOX@}P8TY56uS?G(9C#t*l?$x`ebim z7=5TL$U3`4reh~>?Cg#9e>`8*b}yr?>z>_nv4>61G=<}(X_gHh>EZSiU03j$%2|LM z{~pBtEB-r>|Ch^=yC8We`DqZMHS(?1SlRXPP6^y3O14&nD^l`OoUto?TUWlHD@k!?mHrmqT_x=AFqxk6bvV8; z{mHo@QHH}&-)Bz2-o+pFNIE~ISbgSHL$-8R8jJW=1 Date: Sun, 15 Oct 2023 20:06:58 +0400 Subject: [PATCH 3/3] fix --- DumpTruck/DumpTruck/DrawingDumpCar.cs | 14 ++++++-------- ...Form1.Designer.cs => FormDumpTruck.Designer.cs} | 0 DumpTruck/DumpTruck/{Form1.cs => FormDumpTruck.cs} | 0 .../DumpTruck/{Form1.resx => FormDumpTruck.resx} | 0 4 files changed, 6 insertions(+), 8 deletions(-) rename DumpTruck/DumpTruck/{Form1.Designer.cs => FormDumpTruck.Designer.cs} (100%) rename DumpTruck/DumpTruck/{Form1.cs => FormDumpTruck.cs} (100%) rename DumpTruck/DumpTruck/{Form1.resx => FormDumpTruck.resx} (100%) diff --git a/DumpTruck/DumpTruck/DrawingDumpCar.cs b/DumpTruck/DumpTruck/DrawingDumpCar.cs index 8e19495..e425a5e 100644 --- a/DumpTruck/DumpTruck/DrawingDumpCar.cs +++ b/DumpTruck/DumpTruck/DrawingDumpCar.cs @@ -27,16 +27,14 @@ namespace DumpTruck public bool Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool tent, int width, int height) { + if (width <= _carWidth || height <= _carHeight) + return false; _pictureWidth = width; _pictureHeight = height; - if (_pictureWidth > _carWidth && _pictureHeight > _carHeight) - { - - EntityDumpTruck = new DumpTruck(); - EntityDumpTruck.Init(speed, weight, bodyColor, additionalColor, bodyKit, tent); - return true; - } - return false; + + EntityDumpTruck = new DumpTruck(); + EntityDumpTruck.Init(speed, weight, bodyColor, additionalColor, bodyKit, tent); + return true; } public void SetPosition(int x, int y) diff --git a/DumpTruck/DumpTruck/Form1.Designer.cs b/DumpTruck/DumpTruck/FormDumpTruck.Designer.cs similarity index 100% rename from DumpTruck/DumpTruck/Form1.Designer.cs rename to DumpTruck/DumpTruck/FormDumpTruck.Designer.cs diff --git a/DumpTruck/DumpTruck/Form1.cs b/DumpTruck/DumpTruck/FormDumpTruck.cs similarity index 100% rename from DumpTruck/DumpTruck/Form1.cs rename to DumpTruck/DumpTruck/FormDumpTruck.cs diff --git a/DumpTruck/DumpTruck/Form1.resx b/DumpTruck/DumpTruck/FormDumpTruck.resx similarity index 100% rename from DumpTruck/DumpTruck/Form1.resx rename to DumpTruck/DumpTruck/FormDumpTruck.resx -- 2.25.1