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-12-03 15:02:10 +04:00
|
|
|
|
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)
|
2023-09-25 14:09:42 +04:00
|
|
|
|
{
|
|
|
|
|
if (EntityCruiser != null)
|
|
|
|
|
{
|
2023-12-03 15:02:10 +04:00
|
|
|
|
EntityCruiser = new EntityProCruiser(speed, weight, bodyColor, elemColor, rocketMines, helipad);
|
|
|
|
|
// по тем же причинам, что и для обычного, фиксим конструктор класса отрисовки для улучшенного
|
2023-09-25 14:09:42 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|