Youdakova D.R. PIbd-21 LabWork05 #5
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user