PIbd-21_Anisin_R.S._DumpTru.../DumpTruck/EntityDumpTruck.cs

66 lines
2.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}
}