From 3ad20712566877d1536ce8153eb91a4635a0e739 Mon Sep 17 00:00:00 2001 From: malimova Date: Sun, 22 Oct 2023 13:37:26 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5.=20=D0=97=D0=B0?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=88=D0=B5=D0=BD=D0=B8=D0=B5=20Lab3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirBomber/AirBomber/AbstractStrategy.cs | 4 ++-- AirBomber/AirBomber/DrawningAirPlane.cs | 4 ++-- AirBomber/AirBomber/FormAirBomber.cs | 1 - AirBomber/AirBomber/PlanesGenericCollection.cs | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/AirBomber/AirBomber/AbstractStrategy.cs b/AirBomber/AirBomber/AbstractStrategy.cs index 7b44070..c82b1b6 100644 --- a/AirBomber/AirBomber/AbstractStrategy.cs +++ b/AirBomber/AirBomber/AbstractStrategy.cs @@ -37,6 +37,7 @@ namespace AirBomber public void SetData(IMoveableObject moveableObject, int width, int height) { + if (moveableObject == null) { _state = Status.NotInit; @@ -86,8 +87,7 @@ namespace AirBomber /// /// Параметры объекта /// - protected ObjectParameters? GetObjectParameters => - _moveableObject?.GetObjectPosition; + protected ObjectParameters? GetObjectParameters =>_moveableObject?.GetObjectPosition; /// /// Шаг объекта /// diff --git a/AirBomber/AirBomber/DrawningAirPlane.cs b/AirBomber/AirBomber/DrawningAirPlane.cs index 7401eef..ba2b1e2 100644 --- a/AirBomber/AirBomber/DrawningAirPlane.cs +++ b/AirBomber/AirBomber/DrawningAirPlane.cs @@ -45,7 +45,7 @@ namespace AirBomber /// Основной цвет /// Ширина картинки /// Высота картинки - /*public DrawningAirPlane(int speed, double weight, Color bodyColor, int + public DrawningAirPlane(int speed, double weight, Color bodyColor, int width, int height) { // TODO: Продумать проверки @@ -56,7 +56,7 @@ namespace AirBomber _pictureWidth = width; _pictureHeight = height; EntityAirPlane = new EntityAirPlane(speed, weight, bodyColor); - }*/ + } /// /// Конструктор /// diff --git a/AirBomber/AirBomber/FormAirBomber.cs b/AirBomber/AirBomber/FormAirBomber.cs index fa19f00..c9dff90 100644 --- a/AirBomber/AirBomber/FormAirBomber.cs +++ b/AirBomber/AirBomber/FormAirBomber.cs @@ -59,7 +59,6 @@ namespace AirBomber { Random random = new(); Color color = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)); - ColorDialog dialog = new(); if (dialog.ShowDialog() == DialogResult.OK) { diff --git a/AirBomber/AirBomber/PlanesGenericCollection.cs b/AirBomber/AirBomber/PlanesGenericCollection.cs index 5381999..5d4cbf8 100644 --- a/AirBomber/AirBomber/PlanesGenericCollection.cs +++ b/AirBomber/AirBomber/PlanesGenericCollection.cs @@ -57,7 +57,6 @@ namespace AirBomber } return collect?._collection.Insert(obj) ?? -1; } - /// /// Перегрузка оператора вычитания ///