Youdakova D.R. PIbd-21 LabWork05 #5

Closed
Daniya_Youdakova wants to merge 5 commits from LabWork05 into LabWork04
3 changed files with 10 additions and 3 deletions
Showing only changes of commit b64e68dd77 - Show all commits

View File

@ -14,6 +14,14 @@ dopColor, bool flightDeck, bool hangarDeck, bool route) :
{
AircraftCarrier = new EntityModernAircraftCarrier(speed, weight, bodyColor, dopColor, flightDeck, hangarDeck, route);
}
public void ReturnColor(Color returnColor)
{
if (AircraftCarrier is not EntityModernAircraftCarrier modernAircraftCarrier)
{
return;
}
modernAircraftCarrier.DopColor = returnColor;
}
public override void DrawTransport(Graphics g)
{
if (AircraftCarrier is not EntityModernAircraftCarrier modernAircraftCarrier)
@ -22,7 +30,6 @@ dopColor, bool flightDeck, bool hangarDeck, bool route) :
}
Pen pen = new(Color.Black);
Brush dopBrush = new SolidBrush(modernAircraftCarrier.DopColor);
if (modernAircraftCarrier.FlightDeck)
{
g.DrawRectangle(pen, _startPosX + 10, _startPosY, 160, 10);

View File

@ -10,7 +10,7 @@ namespace AircraftCarrier
{
public int Speed { get; private set; }
public float Weight { get; private set; }
public Color BodyColor { get; private set; }
public Color BodyColor { get; set; }
public float Step => Speed * 100 / Weight;
public EntityAircraftCarrier(int speed, float weight, Color bodyColor)
{

View File

@ -9,7 +9,7 @@ namespace AircraftCarrier
{
internal class EntityModernAircraftCarrier : EntityAircraftCarrier
{
public Color DopColor { get; private set; }
public Color DopColor { get; set; }
public bool FlightDeck { get; private set; }
public bool HangarDeck { get; private set; }
public bool Route { get; private set; }