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..a2153b7 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..449953c 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; } /// /// Признак (опция) наличия башни /// @@ -39,10 +39,10 @@ namespace Battleship.Entities Tower = tower; 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..e46dcc4 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; } /// /// Дополнительный цвет (для опциональных элементов) ///