PIbd-21_MalafeevL.S._Cruise.../Cruiser/Drawing/DrawingProCruiser.cs

42 lines
1.4 KiB
C#
Raw Permalink Normal View History

2023-09-25 14:09:42 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cruiser.Entities;
namespace Cruiser.Drawing
{
public class DrawingProCruiser : DrawingCruiser
{
public DrawingProCruiser(int speed, double weight, Color bodyColor, Color secColor, Color elemColor, bool rocketMines, bool helipad, int width, int height) :
base (speed, weight, bodyColor, secColor, width, height, 150, 60)
{
if (EntityCruiser != null)
{
EntityCruiser = new EntityProCruiser(speed, weight, bodyColor, secColor, elemColor, rocketMines, helipad);
}
}
public override void DrawTransport(Graphics g)
{
if (EntityCruiser is not EntityProCruiser cruiser)
{
return;
}
base.DrawTransport(g);
Brush DopBrush = new SolidBrush(cruiser.ElementsColor);
// шахты
if (cruiser.RocketMines)
{
g.FillRectangle(DopBrush, _startPosX + 15, _startPosY + 10, 10, 15);
g.FillRectangle(DopBrush, _startPosX + 30, _startPosY + 10, 10, 15);
}
// верт площадка
if (cruiser.Helipad)
{
g.FillEllipse(DopBrush, _startPosX + 15, _startPosY + 25, 25, 25);
}
}
}
}