PIbd22_NikiforovaMV_Contain.../ContainerShip/EntityShip.cs

28 lines
689 B
C#
Raw Permalink Normal View History

2023-11-25 12:44:21 +04:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ContainerShip.Entities
{
public class EntityShip
{
public int Speed { get; private set; }
public double Weight { get; private set; }
public Color BodyColor { get; private set; }
public double Step => (double)Speed * 100 / Weight;
public EntityShip(int speed, double weight, Color bodyColor)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
}
2023-12-16 11:16:37 +04:00
public void ChangeBodyColor(Color color)
{
BodyColor = color;
}
2023-11-25 12:44:21 +04:00
}
}