105 lines
3.7 KiB
C#
105 lines
3.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing.Drawing2D;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
using AirFighter.Drawnings;
|
|
using AirFighter.Entities;
|
|
|
|
|
|
|
|
namespace AirFighter.DrawningObjects
|
|
{
|
|
public class DrawningAirFighterMilitary : DrawningAirFighter
|
|
{
|
|
public DrawningAirFighterMilitary(int speed, double weight, Color bodyColor, Color additionalColor, bool rocket, bool wing, int width, int height) :
|
|
base(speed, weight, bodyColor, width, height, 195, 166)
|
|
{
|
|
if (EntityAirFighter != null)
|
|
{
|
|
EntityAirFighter = new EntityAirFighterMilitary(speed, weight, bodyColor,
|
|
additionalColor, rocket, wing);
|
|
}
|
|
}
|
|
public override void DrawTransport(Graphics g)
|
|
{
|
|
if (EntityAirFighter is not EntityAirFighterMilitary fighterMilitary)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Brush additionalBrush = new SolidBrush(fighterMilitary.AdditionalColor);
|
|
|
|
if (fighterMilitary.Wing)
|
|
{
|
|
PointF[] topDopWing =
|
|
{
|
|
new(_startPosX + 78, _startPosY + 56),
|
|
new(_startPosX + 75, _startPosY + 70),
|
|
new(_startPosX + 55, _startPosY + 50),
|
|
new(_startPosX + 60, _startPosY + 45),
|
|
};
|
|
|
|
PointF[] bottomDopWing =
|
|
{
|
|
new(_startPosX + 78, _startPosY + 110),
|
|
new(_startPosX + 75, _startPosY + 96),
|
|
new(_startPosX + 55, _startPosY + 116),
|
|
new(_startPosX + 60, _startPosY + 121),
|
|
};
|
|
|
|
g.FillPolygon(additionalBrush, topDopWing);
|
|
g.FillPolygon(additionalBrush, bottomDopWing);
|
|
|
|
}
|
|
base.DrawTransport(g);
|
|
|
|
if (fighterMilitary.Rocket)
|
|
{
|
|
PointF[] topRocket1 =
|
|
{
|
|
new(_startPosX + 100, _startPosY + 20),
|
|
new(_startPosX + 100, _startPosY + 30),
|
|
new(_startPosX + 112, _startPosY + 30),
|
|
new(_startPosX + 120, _startPosY + 25),
|
|
new(_startPosX + 112, _startPosY + 20)
|
|
};
|
|
|
|
PointF[] topRocket2 =
|
|
{
|
|
new(_startPosX + 100, _startPosY + 35),
|
|
new(_startPosX + 100, _startPosY + 45),
|
|
new(_startPosX + 112, _startPosY + 45),
|
|
new(_startPosX + 120, _startPosY + 40),
|
|
new(_startPosX + 112, _startPosY + 35)
|
|
};
|
|
|
|
PointF[] bottomRocket1 =
|
|
{
|
|
new(_startPosX + 100, _startPosY + 146),
|
|
new(_startPosX + 100, _startPosY + 136),
|
|
new(_startPosX + 112, _startPosY + 136),
|
|
new(_startPosX + 120, _startPosY + 141),
|
|
new(_startPosX + 112, _startPosY + 146)
|
|
};
|
|
|
|
PointF[] bottomRocket2 =
|
|
{
|
|
new(_startPosX + 100, _startPosY + 131),
|
|
new(_startPosX + 100, _startPosY + 121),
|
|
new(_startPosX + 112, _startPosY + 121),
|
|
new(_startPosX + 120, _startPosY + 126),
|
|
new(_startPosX + 112, _startPosY + 131)
|
|
};
|
|
|
|
g.FillPolygon(additionalBrush, topRocket1);
|
|
g.FillPolygon(additionalBrush, topRocket2);
|
|
g.FillPolygon(additionalBrush, bottomRocket1);
|
|
g.FillPolygon(additionalBrush, bottomRocket2);
|
|
}
|
|
}
|
|
}
|
|
}
|