sharee.bike-App/TINKLib/Model/Bikes/BikeInfoNS/DriveNS/DriveMutable.cs
2023-08-31 12:31:38 +02:00

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; }
}
}