using ProjectGasolineTanker.DrawingObjects; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using ProjectGasolineTanker.Entities; namespace ProjectGasolineTanker { public class DrawingGasolineTanker : DrawingTruck { public DrawingGasolineTanker(int speed, double weight, Color bodyColor, Color additionalColor, bool tank, bool wheel, int width, int height) : base(speed, weight, bodyColor, width, height, 130, 70) { if (EntityTruck != null) { EntityTruck = new EntityGasolineTanker(speed, weight, bodyColor, additionalColor, tank, wheel); } } public override void DrawTransport(Graphics g) { if (EntityTruck is not EntityGasolineTanker GasolineTanker) { return; } Pen pen = new(Color.Black); Pen additionalPen = new(GasolineTanker.Body); Brush additionalBrush = new SolidBrush(GasolineTanker.Body); base.DrawTransport(g); if (GasolineTanker.Tank) { g.FillRectangle(additionalBrush, _startPosX + 45, _startPosY + 53, 35, 20); g.DrawLine(pen, _startPosX + 45, _startPosY + 53, _startPosX + 80, _startPosY + 73); g.DrawLine(pen, _startPosX + 80, _startPosY + 53, _startPosX + 45, _startPosY + 73); } if (GasolineTanker.Wheel) { Brush gr = new SolidBrush(Color.Gray); g.FillEllipse(additionalBrush, _startPosX + 85, _startPosY + 55, 22, 22); g.FillEllipse(gr, _startPosX + 87, _startPosY + 57, 18, 18); g.DrawEllipse(pen, _startPosX + 85, _startPosY + 55, 22, 22); } } } }