From d5bbf332849e2a9dba67154ee3dd9170fa53932c Mon Sep 17 00:00:00 2001 From: Adelina888 Date: Tue, 2 Apr 2024 10:25:36 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B5=D0=B4=D0=BE=D1=81=D1=82=D0=B0=D1=8E=D1=89?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionGenericObjects/AbstractCompany.cs | 4 ++-- .../StormtrooperSharingService.cs | 12 ++++++++++-- ProjectStormtrooper/FormStormtrooperCollection.cs | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ProjectStormtrooper/CollectionGenericObjects/AbstractCompany.cs b/ProjectStormtrooper/CollectionGenericObjects/AbstractCompany.cs index 6fc6785..27ff7f5 100644 --- a/ProjectStormtrooper/CollectionGenericObjects/AbstractCompany.cs +++ b/ProjectStormtrooper/CollectionGenericObjects/AbstractCompany.cs @@ -2,7 +2,7 @@ namespace ProjectStormtrooper.CollectionGenericObjects; /// -/// Абстракция компании, хранящий коллекцию бомбардировщиков +/// Абстракция компании, хранящий коллекцию штурмовика /// public abstract class AbstractCompany { @@ -35,7 +35,7 @@ public abstract class AbstractCompany /// /// Ширина окна /// Высота окна - /// Коллекция бомбардировщиков + /// Коллекция штурмовика public AbstractCompany(int picWidth, int picHeight, ICollectionGenericObjects collection) { _pictureWidth = picWidth; diff --git a/ProjectStormtrooper/CollectionGenericObjects/StormtrooperSharingService.cs b/ProjectStormtrooper/CollectionGenericObjects/StormtrooperSharingService.cs index 652c2ca..4fed574 100644 --- a/ProjectStormtrooper/CollectionGenericObjects/StormtrooperSharingService.cs +++ b/ProjectStormtrooper/CollectionGenericObjects/StormtrooperSharingService.cs @@ -6,13 +6,19 @@ using System.Text; using System.Threading.Tasks; namespace ProjectStormtrooper.CollectionGenericObjects; +/// +/// Реализация абстрактной компании +/// public class StormtrooperSharingService : AbstractCompany { public StormtrooperSharingService(int picWidth, int picHeight, ICollectionGenericObjects collection) : base(picWidth, picHeight, collection) { } - + /// + /// Вывод заднего фона + /// + /// protected override void DrawBackgound(Graphics g) { int width = _pictureWidth / _placeSizeWidth; @@ -27,7 +33,9 @@ public class StormtrooperSharingService : AbstractCompany } } } - + /// + /// Расстановка объектов + /// protected override void SetObjectsPosition() { int width = _pictureWidth / _placeSizeWidth; diff --git a/ProjectStormtrooper/FormStormtrooperCollection.cs b/ProjectStormtrooper/FormStormtrooperCollection.cs index 067d8be..5d99278 100644 --- a/ProjectStormtrooper/FormStormtrooperCollection.cs +++ b/ProjectStormtrooper/FormStormtrooperCollection.cs @@ -60,8 +60,8 @@ public partial class FormStormtrooperCollection : Form { case nameof(DrawingStormtrooper): drawningStormtrooperBase = new DrawingStormtrooper(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)), + GetColor(random), + GetColor(random), Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2))); break; case nameof(DrawningStormtrooperBase):