PIbd-14_Pruidze_I.K_Simple_.../ProjectCruiser/EntityBase.cs

27 lines
830 B
C#
Raw Normal View History

2024-06-12 14:29:35 +04:00
namespace ProjectCruiser;
public class EntityBase
{
// свойства
public int Speed { get; private set; } // скорость
public double Weight { get; private set; } // вес
public Color MainColor { get; private set; } // основной цвет
// public bool Deckhouse { get; private set; } // салон на верхней палубе
2024-06-12 14:29:35 +04:00
public double Step => Speed * 100 / Weight;
public int[] values = { 0, 0, 0 };
public EntityBase(int speed, double weight,
Color mainc) // (bool) deckhouse -> default TRUE now
2024-06-12 14:29:35 +04:00
{
Random rn = new();
Speed = speed;
Weight = weight;
MainColor = mainc;
// Deckhouse = deckhouse;
2024-06-12 14:29:35 +04:00
values[0] = rn.Next(1, 4);
values[1] = rn.Next(5, 10);
values[2] = rn.Next(1, 3);
}
}