32 lines
855 B
C#
32 lines
855 B
C#
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;
|
||
}
|
||
}
|
||
}
|