65 lines
2.6 KiB
C#
65 lines
2.6 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using ProjectFighterJet.Entities;
|
|||
|
|
|||
|
namespace ProjectFighterJet.Drawnings;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Класс-сущность <Боевой-самолёт>
|
|||
|
/// </summary>
|
|||
|
public class DrawningFighterJet : DrawningJet
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Конструктор
|
|||
|
/// </summary>
|
|||
|
/// <param name="speed">Скорость</param>
|
|||
|
/// <param name="weight">Вес</param>
|
|||
|
/// <param name="bodyColor">Основной цвет</param>
|
|||
|
/// <param name="additionalColor">Дополнительный цвет</param>
|
|||
|
/// <param name="rockets">Признак наличия ракет</param>
|
|||
|
/// <param name="fuel">Признак наличия топливного бака</param>
|
|||
|
/// <param name="engines">Признак наличия двигателей</param>
|
|||
|
public DrawningFighterJet(int speed, double weight, Color bodyColor, Color additionalColor, bool rockets, bool fuel, bool engines) : base(140,135)
|
|||
|
{
|
|||
|
EntityJet = new EntityFighterJet(speed, weight, bodyColor, additionalColor, rockets, fuel, engines);
|
|||
|
|
|||
|
}
|
|||
|
public override void DrawTransport(Graphics g)
|
|||
|
{
|
|||
|
|
|||
|
if (EntityJet == null || EntityJet is not EntityFighterJet entityFighterJet || !_startPosX.HasValue || !_startPosY.HasValue)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
Brush bodyBrush = new SolidBrush(EntityJet.BodyColor);
|
|||
|
Pen pen = new(Color.Black);
|
|||
|
Brush brBlack = new SolidBrush(Color.Black);
|
|||
|
Brush additionalBrush = new SolidBrush(entityFighterJet.AdditionalColor);
|
|||
|
|
|||
|
base.DrawTransport(g);
|
|||
|
|
|||
|
//Ракеты бомбардировщика
|
|||
|
if (entityFighterJet.Rockets)
|
|||
|
{
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 35, _startPosY.Value + 10, 15, 5);
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 35, _startPosY.Value + 125, 15, 5);
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 35, _startPosY.Value + 50, 15, 5);
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 35, _startPosY.Value + 85, 15, 5);
|
|||
|
}
|
|||
|
|
|||
|
//Двигатели
|
|||
|
if (entityFighterJet.Engines)
|
|||
|
{
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 40, _startPosY.Value + 35, 10, 10);
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 40, _startPosY.Value + 95, 10, 10);
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 40, _startPosY.Value + 20, 10, 10);
|
|||
|
g.FillRectangle(additionalBrush, _startPosX.Value + 40, _startPosY.Value + 110, 10, 10);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|