47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Lab.Entities;
|
|
|
|
namespace Lab.DrawningObjects
|
|
{
|
|
public class DrawGasolineTanker : DrawTanker
|
|
{
|
|
|
|
public DrawGasolineTanker(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine, int width, int height) : base(speed, weight, bodyColor, width, height)
|
|
{
|
|
if (GasolineTanker != null)
|
|
{
|
|
GasolineTanker = new GasolineTanker(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine);
|
|
}
|
|
}
|
|
public override void DrawTransport(Graphics g)
|
|
{
|
|
if (GasolineTanker is not GasolineTanker Gasoline)
|
|
return;
|
|
base.DrawTransport(g);
|
|
if (Gasoline.BodyKit)
|
|
{
|
|
Brush bodyBrush = new SolidBrush(Gasoline.AdditionalColor);
|
|
g.FillEllipse(bodyBrush, 10 + _startPosX, 10 + _startPosY, 70, 30);
|
|
}
|
|
|
|
if (Gasoline.SportLine)
|
|
{
|
|
Brush lineBrush = new SolidBrush(Gasoline.AdditionalColor);
|
|
g.FillRectangle(lineBrush, 15 + _startPosX, 45 + _startPosY, 20, 5);
|
|
g.FillRectangle(lineBrush, 40 + _startPosX, 45 + _startPosY, 20, 5);
|
|
g.FillRectangle(lineBrush, 65 + _startPosX, 45 + _startPosY, 20, 5);
|
|
}
|
|
|
|
if (Gasoline.Wing)
|
|
{
|
|
Brush lightBrush = new SolidBrush(Gasoline.AdditionalColor);
|
|
g.FillRectangle(lightBrush, 87 + _startPosX, 5 + _startPosY, 5, 5);
|
|
}
|
|
}
|
|
}
|
|
}
|