sharee.bike-App/SharedBusinessLogic/Model/Bikes/BikeInfoNS/DriveNS/DriveMutable.cs
2024-04-09 12:53:23 +02:00

53 lines
1.1 KiB
C#

using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.EngineNS;
namespace ShareeBike.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; }
}
}