66 lines
2.1 KiB
C#
66 lines
2.1 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Net.NetworkInformation;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace DumpTruck
|
||
{
|
||
public class EntityDumpTruck
|
||
{
|
||
/// <summary>
|
||
/// Скорость
|
||
/// </summary>
|
||
public int Speed { get; private set; }
|
||
/// <summary>
|
||
/// Вес
|
||
/// </summary>
|
||
public double Weight { get; private set; }
|
||
/// <summary>
|
||
/// Основной цвет
|
||
/// </summary>
|
||
public Color BodyColor { get; private set; }
|
||
/// <summary>
|
||
/// Признак (опция) наличия тента
|
||
/// </summary>
|
||
public bool Tent { get; private set; }
|
||
/// <summary>
|
||
/// Признак (опция) наличия кузова
|
||
/// </summary>
|
||
public bool DumpBox { get; private set; }
|
||
/// <summary>
|
||
/// Цвет кузова
|
||
/// </summary>
|
||
public Color DumpBoxColor { get; private set; }
|
||
/// <summary>
|
||
/// Цвет тента
|
||
/// </summary>
|
||
public Color TentColor { get; private set; }
|
||
/// <summary>
|
||
/// Шаг
|
||
/// </summary>
|
||
public double Step => (double)Speed * 100 / Weight;
|
||
|
||
/// <summary>
|
||
/// Инициализация полей объекта-класса самосвала
|
||
/// </summary>
|
||
/// <param name="speed">Скорость</param>
|
||
/// <param name="weight">Вес самосвала</param>
|
||
/// <param name="bodyColor">Основной цвет самосвала</param>
|
||
/// <param name="tent">Признак наличия тента</param>
|
||
/// <param name="dumpBox">Признак наличия кузова</param>
|
||
/// <param name="dumpBoxColor">Цвет кузова</param>
|
||
/// <param name="tentColor">Цвет тента</param>
|
||
public void Init(int speed, double weight, Color bodyColor, bool tent, bool dumpBox, Color tentColor, Color dumpBoxColor)
|
||
{
|
||
Speed = speed;
|
||
Weight = weight;
|
||
BodyColor = bodyColor;
|
||
Tent = tent;
|
||
DumpBox = dumpBox;
|
||
DumpBoxColor = dumpBoxColor;
|
||
TentColor = tentColor;
|
||
}
|
||
}
|
||
} |