36 lines
863 B
C#
36 lines
863 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace WarmlyLocomotive.Entities;
|
|||
|
/// <summary>
|
|||
|
/// Базовый класс сущности
|
|||
|
/// </summary>
|
|||
|
public class EntityLocomotive
|
|||
|
{
|
|||
|
public int Speed { get; private set; }
|
|||
|
|
|||
|
public double Weight { get; private set; }
|
|||
|
|
|||
|
public Color BodyColor { get; private set; }
|
|||
|
|
|||
|
|
|||
|
public double Step => Speed * 100 / Weight;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Конструктор, заменяющий init
|
|||
|
/// </summary>
|
|||
|
/// <param name="speed">скорость</param>
|
|||
|
/// <param name="weight">вес</param>
|
|||
|
/// <param name="bodyColor">цвет</param>
|
|||
|
public EntityLocomotive(int speed, double weight, Color bodyColor)
|
|||
|
{
|
|||
|
Speed = speed;
|
|||
|
Weight = weight;
|
|||
|
BodyColor = bodyColor;
|
|||
|
}
|
|||
|
|
|||
|
}
|