2022-10-15 22:40:19 +04:00

84 lines
3.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Airbus
{
internal class DrawningAirbus : DrawningPlane
{
/// <summary>
/// Инициализация свойств
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес автомобиля</param>
/// <param name="bodyColor">Цвет кузова</param>
/// <param name="dopColor">Дополнительный цвет</param>
/// <param name="bodyKit">Признак наличия обвеса</param>
/// <param name="wing">Признак наличия антикрыла</param>
/// <param name="sportLine">Признак наличия гоночной полосы</param>
public DrawningAirbus(int speed, float weight, Color bodyColor, Color
dopColor, bool bodyKit, bool wing, bool sportLine) :
base(speed, weight, bodyColor, 140, 70)
{
Plane = new EntityAirbus(speed, weight, bodyColor, dopColor, bodyKit, wing, sportLine);
}
public override void DrawTransport(Graphics g)
{
if (Plane is not EntityAirbus Airbus)
{
return;
}
Pen pen = new(Color.Black);
Brush dopBrush = new SolidBrush(Airbus.DopColor);
Brush fireBrush = new SolidBrush(Color.Red);
Brush WindowBrush = new SolidBrush(Color.Blue);
_startPosX += 10;
_startPosY += 5;
base.DrawTransport(g);
_startPosX -= 10;
_startPosY -= 5;
if (Airbus.BodyKit)
{
//1 реактор
g.DrawRectangle(pen, _startPosX + 70, _startPosY + 50, 22, 16);
g.FillRectangle(dopBrush, _startPosX + 70, _startPosY + 50, 22, 16);
g.FillEllipse(dopBrush, _startPosX + 84, _startPosY + 50, 16, 16);
g.DrawEllipse(pen, _startPosX + 62, _startPosY + 50, 16, 16);
g.FillEllipse(fireBrush, _startPosX + 62, _startPosY + 50, 16, 16);
//2 реактор
g.DrawRectangle(pen, _startPosX + 8, _startPosY + 18, 22, 16);
g.FillRectangle(dopBrush, _startPosX + 8, _startPosY + 18, 22, 16);
g.FillEllipse(dopBrush, _startPosX + 24, _startPosY + 18, 16, 16);
g.DrawEllipse(pen, _startPosX, _startPosY + 18, 16, 16);
g.FillEllipse(fireBrush, _startPosX, _startPosY + 18, 16, 16);
}
if (Airbus.Wing)
{
g.DrawLine(pen, _startPosX + 70, _startPosY + 20, _startPosX + 70, _startPosY + 35);
g.DrawLine(pen, _startPosX + 70, _startPosY + 20, _startPosX + 90, _startPosY + 35);
}
if (Airbus.SportLine)
{
g.DrawEllipse(pen, _startPosX + 110, _startPosY + 40, 9, 9);
g.FillEllipse(WindowBrush, _startPosX + 110, _startPosY + 40, 9, 9);
}
}
}
}