diff --git a/DumpTruck/DumpTruck/DrawingTruck.cs b/DumpTruck/DumpTruck/DrawingTruck.cs index ec65513..b369c3a 100644 --- a/DumpTruck/DumpTruck/DrawingTruck.cs +++ b/DumpTruck/DumpTruck/DrawingTruck.cs @@ -16,7 +16,7 @@ namespace DumpTruck private int _pictureHeight; protected readonly int _truckWidth = 100; protected readonly int _truckHeight = 50; - public bool Init(int speed, float weight, Color bodyColor, Color additionalColor, int width, int height) + public bool Init(int speed, float weight, Color bodyColor, Color additionalColor, int width, int height, bool threeWheels, bool dump) { if (width < _truckWidth || height < _truckHeight) { @@ -25,7 +25,7 @@ namespace DumpTruck _pictureWidth = width; _pictureHeight = height; EntityTruck = new EntityTruck(); - EntityTruck.Init(speed, weight, bodyColor, additionalColor); + EntityTruck.Init(speed, weight, bodyColor, additionalColor, threeWheels, dump); return true; } public void SetPosition(int x, int y) @@ -113,6 +113,7 @@ namespace DumpTruck g.DrawEllipse(pen, _startPosX + 22, _startPosY + 35, 20, 20); g.DrawEllipse(pen, _startPosX + 80, _startPosY + 35, 20, 20); + //Brush brBody = new SolidBrush(EntityTruck?.AdditionalColor ?? Color.Red); Brush brBodyAdditional = new SolidBrush(additionalColor); g.FillRectangle(brBodyAdditional, _startPosX + 0, _startPosY, 70, 30); diff --git a/DumpTruck/DumpTruck/EntityTruck.cs b/DumpTruck/DumpTruck/EntityTruck.cs index 793c885..8f9e4dc 100644 --- a/DumpTruck/DumpTruck/EntityTruck.cs +++ b/DumpTruck/DumpTruck/EntityTruck.cs @@ -16,14 +16,20 @@ namespace DumpTruck public Color BodyColor { get; private set; } public Color AdditionalColor { get; private set; } + public bool ThreeWheels { get; private set; } + + public bool Dump { get; private set; } + public float Step => Speed * 100 / Weight; - public void Init(int speed, float weight, Color bodyColor, Color additionalColor) + public void Init(int speed, float weight, Color bodyColor, Color additionalColor, bool threeWheels, bool dump) { Speed = speed; Weight = weight; BodyColor = bodyColor; AdditionalColor = additionalColor; + ThreeWheels = threeWheels; + Dump = dump; } } } \ No newline at end of file