2021-05-13 20:03:07 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
2022-08-30 15:42:25 +02:00
|
|
|
|
namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
2021-05-13 20:03:07 +02:00
|
|
|
|
{
|
2022-08-30 15:42:25 +02:00
|
|
|
|
public class BikeInfoMutable : Model.Bikes.BikeInfoNS.BC.BikeInfoMutable, IBikeInfoMutable
|
2021-05-13 20:03:07 +02:00
|
|
|
|
{
|
|
|
|
|
/// <summary> Constructs a bike object from source. </summary>
|
2022-01-04 18:59:16 +01:00
|
|
|
|
public BikeInfoMutable(BikeInfo bike, string stationName) : base(
|
2022-08-30 15:42:25 +02:00
|
|
|
|
bike != null
|
|
|
|
|
? bike.Bike
|
|
|
|
|
: throw new ArgumentNullException(nameof(bike)),
|
|
|
|
|
bike.Drive,
|
2021-05-13 20:03:07 +02:00
|
|
|
|
bike.IsDemo,
|
|
|
|
|
bike.Group,
|
2022-01-04 18:59:16 +01:00
|
|
|
|
bike.StationId,
|
|
|
|
|
stationName,
|
2021-05-13 20:03:07 +02:00
|
|
|
|
bike.OperatorUri,
|
|
|
|
|
bike.TariffDescription,
|
|
|
|
|
() => DateTime.Now,
|
|
|
|
|
bike.State)
|
|
|
|
|
{
|
|
|
|
|
LockInfo = new LockInfoMutable(
|
2022-08-30 15:42:25 +02:00
|
|
|
|
bike.LockInfo.Id,
|
2021-05-13 20:03:07 +02:00
|
|
|
|
bike.LockInfo.Guid,
|
|
|
|
|
bike.LockInfo.UserKey,
|
|
|
|
|
bike.LockInfo.AdminKey,
|
|
|
|
|
bike.LockInfo.Seed,
|
|
|
|
|
bike.LockInfo.State);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public LockInfoMutable LockInfo { get; }
|
|
|
|
|
|
|
|
|
|
ILockInfoMutable IBikeInfoMutable.LockInfo => LockInfo;
|
|
|
|
|
}
|
|
|
|
|
}
|