26 lines
694 B
C#
26 lines
694 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ContainerShip
|
|
{
|
|
internal class EntityShip
|
|
{
|
|
public int Speed { get; private set; }
|
|
public float Weight { get; private set; }
|
|
public Color BodyColor { get; private set; }
|
|
public int Step => (int)Speed * 100 / (int)Weight;
|
|
|
|
public void Init(int speed, float weight, Color bodyColor)
|
|
{
|
|
Random random = new Random();
|
|
Speed = speed <= 0 ? random.Next(50, 150) : speed;
|
|
Weight = weight <= 0 ? random.Next(50, 150) : weight;
|
|
BodyColor = bodyColor;
|
|
}
|
|
|
|
}
|
|
}
|