From f6b058b91253fe4e955583226de6852291ffe3fe Mon Sep 17 00:00:00 2001 From: kaznacheeva Date: Tue, 5 Dec 2023 21:44:19 +0400 Subject: [PATCH 1/2] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Battleship/Battleship/DrawningBattleship.cs | 4 ++++ Battleship/Battleship/DrawningShip.cs | 8 ++++++++ Battleship/Battleship/EntityBattleship.cs | 4 ++-- Battleship/Battleship/EntityShip.cs | 4 ++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Battleship/Battleship/DrawningBattleship.cs b/Battleship/Battleship/DrawningBattleship.cs index c0c8d7a..524c6ba 100644 --- a/Battleship/Battleship/DrawningBattleship.cs +++ b/Battleship/Battleship/DrawningBattleship.cs @@ -48,5 +48,9 @@ namespace Battleship.DrawningObjects g.DrawRectangle(pen, _startPosX + 75, _startPosY + 70, 40, 10); } } + public void SetAddColor(Color color) + { + ((EntityBattleship)EntityShip).AdditionalColor = color; + } } } diff --git a/Battleship/Battleship/DrawningShip.cs b/Battleship/Battleship/DrawningShip.cs index 6a56b76..ef435bf 100644 --- a/Battleship/Battleship/DrawningShip.cs +++ b/Battleship/Battleship/DrawningShip.cs @@ -224,6 +224,14 @@ namespace Battleship.DrawningObjects break; } } + public void SetColor(Color color) + { + if(EntityShip == null) + { + return; + } + EntityShip.BodyColor = color; + } } } diff --git a/Battleship/Battleship/EntityBattleship.cs b/Battleship/Battleship/EntityBattleship.cs index f3cd02c..6175764 100644 --- a/Battleship/Battleship/EntityBattleship.cs +++ b/Battleship/Battleship/EntityBattleship.cs @@ -10,7 +10,7 @@ namespace Battleship.Entities internal class EntityBattleship: EntityShip { - public Color AdditionalColor { get; private set; } + public Color AdditionalColor { get; set; } /// /// Признак (опция) наличия башни /// @@ -40,7 +40,7 @@ namespace Battleship.Entities Section = section; } - internal void setAdditionalColor(Color color) + public void setAdditionalColor(Color color) { AdditionalColor = color; } diff --git a/Battleship/Battleship/EntityShip.cs b/Battleship/Battleship/EntityShip.cs index db19207..ea7eef1 100644 --- a/Battleship/Battleship/EntityShip.cs +++ b/Battleship/Battleship/EntityShip.cs @@ -19,7 +19,7 @@ namespace Battleship.Entities /// /// Основной цвет /// - public Color BodyColor { get; private set; } + public Color BodyColor { get; set; } /// /// Дополнительный цвет (для опциональных элементов) /// @@ -38,7 +38,7 @@ namespace Battleship.Entities BodyColor = bodyColor; } - internal void setBodyColor(Color color) + public void setBodyColor(Color color) { BodyColor = color; } From c8a60fa26fa3d2191df3e2deb15d39e7bbe1ee0c Mon Sep 17 00:00:00 2001 From: kaznacheeva Date: Wed, 6 Dec 2023 10:10:31 +0400 Subject: [PATCH 2/2] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Battleship/Battleship/DrawningBattleship.cs | 4 ---- Battleship/Battleship/DrawningShip.cs | 8 -------- 2 files changed, 12 deletions(-) diff --git a/Battleship/Battleship/DrawningBattleship.cs b/Battleship/Battleship/DrawningBattleship.cs index 524c6ba..c0c8d7a 100644 --- a/Battleship/Battleship/DrawningBattleship.cs +++ b/Battleship/Battleship/DrawningBattleship.cs @@ -48,9 +48,5 @@ namespace Battleship.DrawningObjects g.DrawRectangle(pen, _startPosX + 75, _startPosY + 70, 40, 10); } } - public void SetAddColor(Color color) - { - ((EntityBattleship)EntityShip).AdditionalColor = color; - } } } diff --git a/Battleship/Battleship/DrawningShip.cs b/Battleship/Battleship/DrawningShip.cs index ef435bf..6a56b76 100644 --- a/Battleship/Battleship/DrawningShip.cs +++ b/Battleship/Battleship/DrawningShip.cs @@ -224,14 +224,6 @@ namespace Battleship.DrawningObjects break; } } - public void SetColor(Color color) - { - if(EntityShip == null) - { - return; - } - EntityShip.BodyColor = color; - } } }