PIbd-22-Romanov-E.V.-Hoisti.../HoistingCrane/HoistingCrane/EntityHoistingCrane.cs
10Г Егор Романов 001fc02ae2 исправления
2022-12-04 17:25:38 +04:00

24 lines
678 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HoistingCrane
{
public class EntityHoistingCrane
{
public int Speed { get; private set; }
public float Weight { get; private set; }
public Color BodyColor { get; set; }
public float Step => Speed * 100 / Weight;
public EntityHoistingCrane(int speed, float weight, Color bodyColor)
{
Random rnd = new();
Speed = speed <= 0 ? rnd.Next(30, 100) : speed;
Weight = weight <= 0 ? rnd.Next(300, 500) : weight;
BodyColor = bodyColor;
}
}
}