53 lines
2.2 KiB
C#
53 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GasolineTanker
|
|
{
|
|
internal class DrawingImprovedGasolineTanker : DrawingGasolineTanker
|
|
{
|
|
public DrawingImprovedGasolineTanker(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool ornamentWheels) :
|
|
base(speed, weight, bodyColor, 160, 55)
|
|
{
|
|
GasolineTanker = new EntityImprovedGasolineTanker(speed, weight, bodyColor, dopColor, bodyKit, ornamentWheels);
|
|
}
|
|
public DrawingImprovedGasolineTanker Copy(int? speed = null, float? weight = null, Color? bodyColor = null, Color? dopColor = null, bool? hasBombs = null, bool? hasFuelTanks = null)
|
|
{
|
|
var e = (EntityImprovedGasolineTanker)GasolineTanker;
|
|
return new DrawingImprovedGasolineTanker(speed ?? e.Speed, weight ?? e.Weight, bodyColor ?? e.BodyColor, dopColor ?? e.DopColor, hasBombs ?? e.BodyKit, hasFuelTanks ?? e.OrnamentWheels);
|
|
}
|
|
public override void DrawTransport(Graphics g)
|
|
{
|
|
if (GasolineTanker is not EntityImprovedGasolineTanker improvedGasolineTanker)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (improvedGasolineTanker.BodyKit)
|
|
{
|
|
Brush dopBrush = new SolidBrush(improvedGasolineTanker.DopColor);
|
|
g.FillRectangle(dopBrush, _startPosX + 25, _startPosY + 5, 100, 35);
|
|
Brush brRed = new SolidBrush(Color.Red);
|
|
g.FillRectangle(brRed, _startPosX + 80, _startPosY, 10, 5);
|
|
}
|
|
|
|
_startPosX += 10;
|
|
_startPosY += 5;
|
|
base.DrawTransport(g);
|
|
_startPosX -= 10;
|
|
_startPosY -= 5;
|
|
|
|
if (improvedGasolineTanker.OrnamentWheels)
|
|
{
|
|
Pen penGray = new(Color.Gray);
|
|
Brush brBlack = new SolidBrush(Color.Gray);
|
|
g.DrawEllipse(penGray, _startPosX + 140, _startPosY + 50, 20, 5);
|
|
g.DrawEllipse(penGray, _startPosX + 40, _startPosY + 50, 20, 5);
|
|
g.DrawEllipse(penGray, _startPosX + 20, _startPosY + 50, 20, 5);
|
|
}
|
|
}
|
|
}
|
|
}
|