using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS; using TINK.Model.Bikes.BikeInfoNS.DriveNS.EngineNS; namespace TINK.Model.Bikes.BikeInfoNS.DriveNS { public enum DriveType { /// /// Bike without pedalling aid. /// SoleHumanPowered, /// /// pedal electric cycle: Pedalling is assisted by an electric engine. /// 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; } /// /// Gets the type of the drive. /// public DriveType Type { get; private set; } /// /// Engine driving the bike. /// public IEngine Engine { get; private set; } /// /// Battery powering the engine. /// public IBattery _Battery = new Battery.Builder().Build(); /// /// Battery powering the engine. /// public IBattery Battery { get => _Battery; set => _Battery = value ?? new Battery.Builder().Build(); } } }