PIbd-21_Egorov_M.A._Sailboa.../Sailboat/Sailboat/EntityBoat.cs

32 lines
855 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sailboat.Entities
{
public class EntityBoat
{
public int Speed { get; private set; }
public double Weight { get; private set; }
public Color BodyColor { get; private set; }
public void setBodyColor(Color color) { BodyColor = color; }
public double Step => (double)Speed * 100 / Weight;
public void ChangeColor(Color color)
{
BodyColor = color;
}
/// <summary>
/// Конструктор с параметрами
/// </summary>
public EntityBoat(int speed, double weight, Color bodyColor)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
}
}
}