правки

This commit is contained in:
Казначеева Елизавета 2023-12-05 21:44:19 +04:00
parent 2b46380712
commit f6b058b912
4 changed files with 16 additions and 4 deletions

View File

@ -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;
}
}
}

View File

@ -224,6 +224,14 @@ namespace Battleship.DrawningObjects
break;
}
}
public void SetColor(Color color)
{
if(EntityShip == null)
{
return;
}
EntityShip.BodyColor = color;
}
}
}

View File

@ -10,7 +10,7 @@ namespace Battleship.Entities
internal class EntityBattleship: EntityShip
{
public Color AdditionalColor { get; private set; }
public Color AdditionalColor { get; set; }
/// <summary>
/// Признак (опция) наличия башни
/// </summary>
@ -40,7 +40,7 @@ namespace Battleship.Entities
Section = section;
}
internal void setAdditionalColor(Color color)
public void setAdditionalColor(Color color)
{
AdditionalColor = color;
}

View File

@ -19,7 +19,7 @@ namespace Battleship.Entities
/// <summary>
/// Основной цвет
/// </summary>
public Color BodyColor { get; private set; }
public Color BodyColor { get; set; }
/// <summary>
/// Дополнительный цвет (для опциональных элементов)
/// </summary>
@ -38,7 +38,7 @@ namespace Battleship.Entities
BodyColor = bodyColor;
}
internal void setBodyColor(Color color)
public void setBodyColor(Color color)
{
BodyColor = color;
}