sharee.bike-App/TINKLib/Model/Bikes/BikeInfoNS/DriveNS/Drive.cs
Anja Müller-Meißner 0468955d49 Version 3.0.338
2022-09-08 09:55:14 +02:00

63 lines
1.3 KiB
C#

using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.EngineNS;
namespace TINK.Model.Bikes.BikeInfoNS.DriveNS
{
public enum DriveType
{
/// <summary>
/// Bike without pedalling aid.
/// </summary>
SoleHumanPowered,
/// <summary>
/// pedal electric cycle: Pedalling is assisted by an electric engine.
/// </summary>
Pedelec
}
public class Drive
{
public Drive(
IEngine engine = null,
IBattery battery = null)
{
if (engine == null)
{
Engine = new Engine();
Battery = new Battery.Builder().Build();
Type = DriveType.SoleHumanPowered;
return;
}
Engine = engine;
Battery = battery ?? new Battery.Builder().Build();
Type = DriveType.Pedelec;
}
/// <summary>
/// Gets the type of the drive.
/// </summary>
public DriveType Type { get; private set; }
/// <summary>
/// Engine driving the bike.
/// </summary>
public IEngine Engine { get; private set; }
/// <summary>
/// Battery powering the engine.
/// </summary>
public IBattery _Battery = new Battery.Builder().Build();
/// <summary>
/// Battery powering the engine.
/// </summary>
public IBattery Battery
{
get => _Battery;
set => _Battery = value ?? new Battery.Builder().Build();
}
}
}