52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace Airbus
|
||
{
|
||
internal class DrawningSuperAirbus : DrawningAirbus
|
||
{
|
||
//Инициализаци свойств
|
||
public DrawningSuperAirbus(int speed, float weight, Color corpusColor, Color addColor, bool addCompartment, bool addEngine) :
|
||
base(speed, weight, corpusColor, 110, 60)
|
||
{
|
||
Airbus = new EntitySuperAirbus(speed, weight, corpusColor, addColor, addCompartment, addEngine);
|
||
}
|
||
|
||
public override void DrawTransport(Graphics g)
|
||
{
|
||
if (Airbus is not EntitySuperAirbus superAirbus)
|
||
{
|
||
return;
|
||
}
|
||
|
||
Pen pen = new(Color.Black);
|
||
Brush addBrush = new SolidBrush(superAirbus.AddColor);
|
||
|
||
//дополнительный пассажирский отсек
|
||
if (superAirbus.AddСompartment)
|
||
{
|
||
g.FillRectangle(addBrush, _startPosX + 30, _startPosY + 12, 14, 3);
|
||
g.DrawRectangle(pen, _startPosX + 30, _startPosY + 12, 14, 3);
|
||
}
|
||
|
||
_startPosX += 10;
|
||
_startPosY += 5;
|
||
base.DrawTransport(g);
|
||
_startPosX -= 10;
|
||
_startPosY -= 5;
|
||
|
||
//дополнительный двигатель
|
||
if (superAirbus.AddEngine)
|
||
{
|
||
g.FillEllipse(addBrush, _startPosX + 24, _startPosY + 22, 10, 5);
|
||
g.DrawEllipse(pen, _startPosX + 24, _startPosY + 22, 10, 5);
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
}
|