mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-16 23:26:26 +01:00
53 lines
1.1 KiB
C#
53 lines
1.1 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 pedaling aid.
|
|
/// </summary>
|
|
SoleHumanPowered,
|
|
|
|
/// <summary>
|
|
/// pedal electric cycle: Pedaling is assisted by an electric engine.
|
|
/// </summary>
|
|
Pedelec
|
|
}
|
|
|
|
public class DriveMutable
|
|
{
|
|
public DriveMutable(
|
|
IEngine engine = null,
|
|
IBattery battery = null)
|
|
{
|
|
if (engine == null)
|
|
{
|
|
Engine = new Engine();
|
|
Battery = new BatteryMutable(new Battery.Builder().Build());
|
|
Type = DriveType.SoleHumanPowered;
|
|
return;
|
|
}
|
|
|
|
Engine = engine;
|
|
Battery = new BatteryMutable(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 IBatteryMutable Battery { get; private set; }
|
|
}
|
|
}
|