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

28 lines
840 B
C#
Raw Normal View History

2024-06-12 19:21:59 +04:00
namespace ProjectCruiser.Entities;
2024-06-12 14:29:35 +04:00
public class EntityBase
{
// свойства
public int Speed { get; private set; } // скорость
public double Weight { get; private set; } // вес
public Color MainColor { get; private set; } // основной цвет
2024-06-12 19:21:59 +04:00
// 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 };
2024-06-12 19:21:59 +04:00
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);
}
}