2024-10-03 01:16:11 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ProjectGasolineTanker.Entities
|
|
|
|
|
{
|
2024-10-03 01:40:53 +04:00
|
|
|
|
|
2024-10-03 01:16:11 +04:00
|
|
|
|
public class EntityTruck
|
|
|
|
|
{
|
2024-10-03 01:46:41 +04:00
|
|
|
|
|
2024-10-03 01:16:11 +04:00
|
|
|
|
public int Speed { get; private set; }
|
2024-10-03 01:46:41 +04:00
|
|
|
|
|
2024-10-03 01:16:11 +04:00
|
|
|
|
public double Weight { get; private set; }
|
2024-10-03 01:40:53 +04:00
|
|
|
|
|
2024-10-03 01:16:11 +04:00
|
|
|
|
public Color BodyColor { get; private set; }
|
2024-10-03 01:40:53 +04:00
|
|
|
|
|
2024-10-03 01:16:11 +04:00
|
|
|
|
public double Step => (double)Speed * 100 / Weight;
|
2024-10-03 01:40:53 +04:00
|
|
|
|
|
2024-10-03 01:16:11 +04:00
|
|
|
|
public EntityTruck(int speed, double weight, Color bodyColor)
|
|
|
|
|
{
|
|
|
|
|
Speed = speed;
|
|
|
|
|
Weight = weight;
|
|
|
|
|
BodyColor = bodyColor;
|
|
|
|
|
}
|
2024-10-03 01:40:53 +04:00
|
|
|
|
|
2024-10-03 01:43:12 +04:00
|
|
|
|
public void ChangeBodyColor(Color color)
|
|
|
|
|
{
|
|
|
|
|
BodyColor = color;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-03 01:16:11 +04:00
|
|
|
|
}
|
2024-10-03 01:40:53 +04:00
|
|
|
|
}
|