50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// установка цвета про лайнера
|
|
/// </summary>
|
|
public void setElementColor(Color color)
|
|
{
|
|
(EntityCruiser as EntityProCruiser).ElementsColor = color;
|
|
}
|
|
public DrawingProCruiser(int speed, double weight, Color bodyColor, Color elemColor, bool rocketMines, bool helipad, int width, int height) :
|
|
base (speed, weight, bodyColor, width, height, 150, 60)
|
|
{
|
|
if (EntityCruiser != null)
|
|
{
|
|
EntityCruiser = new EntityProCruiser(speed, weight, bodyColor, 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);
|
|
}
|
|
}
|
|
}
|
|
}
|