sharee.bike-App/SharedBusinessLogic/Model/Bikes/BikeInfoNS/DriveNS/DriveMutable.cs

54 lines
1.1 KiB
C#
Raw Permalink Normal View History

2024-04-09 12:53:23 +02:00
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.EngineNS;
2022-08-30 15:42:25 +02:00
2024-04-09 12:53:23 +02:00
namespace ShareeBike.Model.Bikes.BikeInfoNS.DriveNS
2022-08-30 15:42:25 +02:00
{
2022-09-06 16:08:19 +02:00
public enum DriveType
{
/// <summary>
2023-08-31 12:31:38 +02:00
/// Bike without pedaling aid.
2022-09-06 16:08:19 +02:00
/// </summary>
SoleHumanPowered,
/// <summary>
2023-08-31 12:31:38 +02:00
/// pedal electric cycle: Pedaling is assisted by an electric engine.
2022-09-06 16:08:19 +02:00
/// </summary>
Pedelec
}
2023-08-31 12:31:38 +02:00
public class DriveMutable
2022-09-06 16:08:19 +02:00
{
2023-08-31 12:31:38 +02:00
public DriveMutable(
2022-09-06 16:08:19 +02:00
IEngine engine = null,
IBattery battery = null)
{
if (engine == null)
{
Engine = new Engine();
2023-08-31 12:31:38 +02:00
Battery = new BatteryMutable(new Battery.Builder().Build());
2022-09-06 16:08:19 +02:00
Type = DriveType.SoleHumanPowered;
return;
}
Engine = engine;
2023-08-31 12:31:38 +02:00
Battery = new BatteryMutable(battery ?? new Battery.Builder().Build());
2022-09-06 16:08:19 +02:00
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>
2023-08-31 12:31:38 +02:00
public IBatteryMutable Battery { get; private set; }
2022-09-06 16:08:19 +02:00
}
2022-08-30 15:42:25 +02:00
}