mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-16 15:16:34 +01:00
62 lines
1.3 KiB
C#
62 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();
|
|
}
|
|
}
|
|
}
|