ISEBbd-22_Novopoltsev_A.A._.../Warship/Warship/EntityWarship.cs
2022-12-16 23:12:13 +03:00

25 lines
678 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Warship
{
public class EntityWarship
{
public int Speed { get; private set; }
public float Weight { get; private set; }
public Color BodyColor { get; private set; }
public int Step => (int)(Speed * 2000 / Weight);
public EntityWarship(int speed, float weight, Color bodyColor)
{
Random rnd = new();
Speed = speed <= 0 ? rnd.Next(10, 60) : speed;
Weight = weight <= 0 ? rnd.Next(20000, 23000) : weight;
BodyColor = bodyColor;
}
}
}