2023-09-22 21:05:01 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Hydroplane
|
|
|
|
|
{
|
|
|
|
|
public class EntityHydroplane
|
|
|
|
|
{
|
|
|
|
|
/// <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>
|
2023-09-22 23:38:10 +04:00
|
|
|
|
/// Признак (опция) наличия надувной лодки
|
2023-09-22 21:05:01 +04:00
|
|
|
|
/// </summary>
|
2023-09-22 23:38:10 +04:00
|
|
|
|
public bool Boat { get; private set; }
|
2023-09-22 21:05:01 +04:00
|
|
|
|
/// <summary>
|
2023-09-22 23:38:10 +04:00
|
|
|
|
/// Признак (опция) наличия поплавка
|
2023-09-22 21:05:01 +04:00
|
|
|
|
/// </summary>
|
2023-09-22 23:38:10 +04:00
|
|
|
|
public bool Bobber { get; private set; }
|
2023-09-22 21:05:01 +04:00
|
|
|
|
/// <summary>
|
2023-09-23 12:02:28 +04:00
|
|
|
|
/// Шаг перемещения гидроплана
|
2023-09-22 21:05:01 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
public double Step => (double)Speed * 100 / Weight;
|
|
|
|
|
/// <summary>
|
2023-09-23 12:02:28 +04:00
|
|
|
|
/// Инициализация полей объекта-класса гидроплана
|
2023-09-22 21:05:01 +04:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="speed">Скорость</param>
|
2023-09-23 12:02:28 +04:00
|
|
|
|
/// <param name="weight">Вес гидроплана</param>
|
2023-09-22 21:05:01 +04:00
|
|
|
|
/// <param name="bodyColor">Основной цвет</param>
|
|
|
|
|
/// <param name="additionalColor">Дополнительный цвет</param>
|
2023-09-23 12:02:28 +04:00
|
|
|
|
/// <param name="boat">Признак наличия надувной лодки</param>
|
|
|
|
|
/// <param name="bobber">Признак наличия поплавков</param>
|
2023-09-22 21:05:01 +04:00
|
|
|
|
public void Init(int speed, double weight, Color bodyColor, Color
|
2023-09-22 23:38:10 +04:00
|
|
|
|
additionalColor, bool boat, bool bobber)
|
2023-09-22 21:05:01 +04:00
|
|
|
|
{
|
|
|
|
|
Speed = speed;
|
|
|
|
|
Weight = weight;
|
|
|
|
|
BodyColor = bodyColor;
|
|
|
|
|
AdditionalColor = additionalColor;
|
2023-09-22 23:38:10 +04:00
|
|
|
|
Boat = boat;
|
|
|
|
|
Bobber = bobber;
|
2023-09-22 21:05:01 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|