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
|
|
|
|
|
{
|
2022-10-10 19:59:31 +04:00
|
|
|
|
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;
|
2022-10-10 19:59:31 +04:00
|
|
|
|
public EntityHoistingCrane(int speed, float weight, Color bodyColor)
|
2022-10-10 18:25:02 +04:00
|
|
|
|
{
|
|
|
|
|
Random rnd = new();
|
2022-10-10 19:59:31 +04:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|