PIbd-22-Romanov-E.V.-Hoisti.../HoistingCrane/HoistingCrane/EntityHoistingCrane.cs

24 lines
678 B
C#
Raw Normal View History

2022-10-10 18:25:02 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HoistingCrane
{
public class EntityHoistingCrane
2022-10-10 18:25:02 +04:00
{
public int Speed { get; private set; }
public float Weight { get; private set; }
2022-11-06 17:48:12 +04:00
public Color BodyColor { get; set; }
2022-10-10 18:25:02 +04:00
public float Step => Speed * 100 / Weight;
public EntityHoistingCrane(int speed, float weight, Color bodyColor)
2022-10-10 18:25:02 +04:00
{
Random rnd = new();
Speed = speed <= 0 ? rnd.Next(30, 100) : speed;
Weight = weight <= 0 ? rnd.Next(300, 500) : weight;
2022-10-10 18:25:02 +04:00
BodyColor = bodyColor;
}
}
}