Исправления в DrawningAirBomber

This commit is contained in:
malimova 2023-10-06 21:25:37 +04:00
parent 5a4093e10f
commit 63b5bc994b

View File

@ -30,17 +30,16 @@ namespace AirBomber
{
EntityAirPlane = new EntityAirBomber(speed, weight, bodyColor, additionalColor, bombs, fuelTanks);
}
}
public override void DrawPlane(Graphics g)
{
if (EntityAirPlane is not EntityAirPlane sportCar)
if (EntityAirPlane is not EntityAirPlane airBomber)
{
return;
}
Pen pen = new(Color.Black);
Brush additionalBrush = new
SolidBrush(airBomber.AdditionalColor);
Brush additionalBrush = new SolidBrush(airBomber.AdditionalColor);
base.DrawPlane(g);
// обвесы
if (airBomber.Bombs)
{
@ -51,9 +50,8 @@ namespace AirBomber
g.FillEllipse(bombsColor, _startPosX + 140, _startPosY + 50, 15, 15);
g.DrawEllipse(pen, _startPosX + 140, _startPosY + 50, 15, 15);
}
base.DrawPlane(g);
// fueltanks
if (EntityAirBomber.FuelTanks)
if (airBomber.FuelTanks)
{
g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 34, 20, 15);
g.DrawRectangle(pen, _startPosX + 63, _startPosY + 34, 20, 15);