PIbd-12_Ulybin_A.A._Monorai.../ProjectMonorail/EntityMonorail.cs

75 lines
2.2 KiB
C#
Raw 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.Text;
using System.Threading.Tasks;
namespace ProjectMonorail;
/// <summary>
/// Класс-сущность "Монорельс"
/// </summary>
public class EntityMonorail
{
/// <summary>
/// Скорость
/// </summary>
public int Speed { get; private set; }
/// <summary>
/// Вес
/// </summary>
public double Weight { get; private set; }
/// <summary>
/// Количество колёс
/// </summary>
public int Wheels { get; private set; }
/// <summary>
/// Основной цвет
/// </summary>
public Color MainColor { get; private set; }
/// <summary>
/// Дополнительный цвет
/// </summary>
public Color AdditionalColor { get; private set; }
/// <summary>
/// Признак наличия магнитного рельса
/// </summary>
public bool Rail { get; private set; }
/// <summary>
/// Признак наличия второго вагона
/// </summary>
public bool SecondСarriage { get; private set; }
/// <summary>
/// Шаг передвижения
/// </summary>
public double Step => Speed * 100 / Weight;
/// <summary>
///
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="wheels">Количество колёс</param>
/// <param name="mainColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="rail">Признак наличия магнитного рельса</param>
/// <param name="secondCarriage">Признак наличия второго вагона</param>
public void Init(int speed, double weight, int wheels, Color mainColor, Color additionalColor, bool rail, bool secondCarriage)
{
Speed = speed;
Weight = weight;
Wheels = wheels;
MainColor = mainColor;
AdditionalColor = additionalColor;
Rail = rail;
SecondСarriage = secondCarriage;
}
}