sharee.bike-App/TINKLib/Model/Stations/StationNS/Station.cs

54 lines
1.9 KiB
C#
Raw Normal View History

2023-04-19 12:14:14 +02:00
using System;
2021-05-13 20:03:07 +02:00
using System.Collections.Generic;
2023-04-19 12:14:14 +02:00
using TINK.Model.Stations.StationNS.Operator;
2021-05-13 20:03:07 +02:00
2023-04-19 12:14:14 +02:00
namespace TINK.Model.Stations.StationNS
2021-05-13 20:03:07 +02:00
{
2022-09-06 16:08:19 +02:00
/// <summary> Holds station info. </summary>
public class Station : IStation
{
/// <summary> Constructs a station object.</summary>
/// <param name="id">Id of the station.</param>
/// <param name="group">Group (TINK, Konrad) to which station is related.</param>
/// <param name="position">GPS- position of the station.</param>
/// <param name="stationName">Name of the station.</param>
public Station(
string id,
2023-05-09 08:47:52 +02:00
IEnumerable<string> group = null,
IPosition position = null,
2022-09-06 16:08:19 +02:00
string stationName = "",
2023-05-09 08:47:52 +02:00
IData operatorData = null,
IBikeGroupCol bikeGropCol = null)
2022-09-06 16:08:19 +02:00
{
Id = id;
Group = group ?? throw new ArgumentException("Can not construct station object. Group of stations must not be null.");
Position = position;
StationName = stationName ?? string.Empty;
OperatorData = operatorData ?? new Data();
2023-05-09 08:47:52 +02:00
BikeGroups = bikeGropCol ?? new BikeGroupCol();
2022-09-06 16:08:19 +02:00
}
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the unique id of the station.c</summary>
public string Id { get; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the group to which the station belongs.</summary>
public IEnumerable<string> Group { get; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Gets the name of the station.</summary>
public string StationName { get; }
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
/// <summary> Holds the gps- position of the station.</summary>
public IPosition Position { get; }
2022-09-06 16:08:19 +02:00
/// <summary> Holds operator related info.</summary>
public IData OperatorData { get; }
2023-05-09 08:47:52 +02:00
/// <summary> Gets the count of bikes available at station. </summary>
public int? AvailableBikesCount => BikeGroups.AvailableCount;
/// <summary> Gets bike <see cref="BikeGroupCol.Entry"/> objects. </summary>
/// <remarks> Each entry has a name, holds the count of available bikes at station and the group value. /// </remarks>
public IBikeGroupCol BikeGroups { get; }
2022-09-06 16:08:19 +02:00
}
2021-05-13 20:03:07 +02:00
}