mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 02:26:29 +01:00
40 lines
981 B
C#
40 lines
981 B
C#
using System;
|
|
|
|
namespace TINK.Model.Bikes.BikeInfoNS.BluetoothLock
|
|
{
|
|
public class BikeInfoMutable : Model.Bikes.BikeInfoNS.BC.BikeInfoMutable, IBikeInfoMutable
|
|
{
|
|
/// <summary> Constructs a bike object from source. </summary>
|
|
public BikeInfoMutable(BikeInfo bike, string stationName) : base(
|
|
bike != null
|
|
? bike.Bike
|
|
: throw new ArgumentNullException(nameof(bike)),
|
|
bike.Drive,
|
|
bike.IsDemo,
|
|
bike.Group,
|
|
bike.StationId,
|
|
stationName,
|
|
bike.OperatorUri,
|
|
bike.TariffDescription,
|
|
() => DateTime.Now,
|
|
bike.State)
|
|
{
|
|
LockInfo = new LockInfoMutable(
|
|
bike.LockInfo.Id,
|
|
bike.LockInfo.Guid,
|
|
bike.LockInfo.UserKey,
|
|
bike.LockInfo.AdminKey,
|
|
bike.LockInfo.Seed,
|
|
bike.LockInfo.State);
|
|
}
|
|
|
|
public LockInfoMutable LockInfo { get; }
|
|
|
|
ILockInfoMutable IBikeInfoMutable.LockInfo => LockInfo;
|
|
|
|
public new string ToString()
|
|
{
|
|
return $"Id={Id}{(TypeOfBike != null ? $";type={TypeOfBike}" : "")};state={State}";
|
|
}
|
|
}
|
|
}
|