PIbd-23 Yakobchuk S.V. LabWork_02 #2
@ -4,38 +4,28 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sailboat
|
||||
namespace Sailboat.Entities
|
||||
{
|
||||
public class EntitySailboat
|
||||
/// <summary>
|
||||
/// Класс-сущность "Парусная лодка"
|
||||
/// </summary>
|
||||
public class EntitySailboat : EntityBoat
|
||||
{
|
||||
/// <summary>
|
||||
/// Скорость
|
||||
/// </summary>
|
||||
public int Speed { get; private set; }
|
||||
/// <summary>
|
||||
/// Вес
|
||||
/// </summary>
|
||||
public double Weight { get; private set; }
|
||||
/// <summary>
|
||||
/// Основной цвет
|
||||
/// </summary>
|
||||
public Color BodyColor { get; private set; }
|
||||
/// <summary>
|
||||
/// Дополнительный цвет (для опциональных элементов)
|
||||
/// </summary>
|
||||
public Color AdditionalColor { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Признак (опция) наличия усиленного корпуса
|
||||
/// </summary>
|
||||
public bool Hull { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Признак (опция) наличия паруса
|
||||
/// </summary>
|
||||
public bool Sail { get; private set; }
|
||||
/// <summary>
|
||||
/// Шаг перемещения лодки
|
||||
/// </summary>
|
||||
public double Step => (double)Speed * 100 / Weight;
|
||||
|
||||
/// <summary>
|
||||
/// Инициализация полей объекта-класса парусной лодки
|
||||
/// </summary>
|
||||
@ -45,12 +35,9 @@ namespace Sailboat
|
||||
/// <param name="additionalColor">Дополнительный цвет</param>
|
||||
/// <param name="hull">Признак наличия усиленного корпуса</param>
|
||||
/// <param name="sail">Признак наличия паруса</param>
|
||||
public void Init(int speed, double weight, Color bodyColor, Color
|
||||
additionalColor, bool hull, bool sail)
|
||||
public EntitySailboat(int speed, double weight, Color bodyColor, Color
|
||||
additionalColor, bool hull, bool sail) : base(speed, weight, bodyColor)
|
||||
{
|
||||
Speed = speed;
|
||||
Weight = weight;
|
||||
BodyColor = bodyColor;
|
||||
AdditionalColor = additionalColor;
|
||||
Hull = hull;
|
||||
Sail = sail;
|
||||
|
Loading…
Reference in New Issue
Block a user