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

49 lines
1.6 KiB
C#
Raw 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
{
2023-11-24 12:12:46 +04:00
/// <summary>
/// установка цвета про лайнера
/// </summary>
public void setElementColor(Color color)
{
(EntityCruiser as EntityProCruiser).ElementsColor = color;
}
2023-09-25 14:09:42 +04:00
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);
}
}
}
}