From b9b4f231ade33bef7b5b1ed4adab933da730963d Mon Sep 17 00:00:00 2001 From: Columbus Utrigas Date: Thu, 31 Mar 2022 17:59:55 +0400 Subject: [PATCH] lines, timetables, stoppoints --- .gitignore | 2 ++ Entities/AdditionalProperties.cs | 10 +++++++ Entities/ApiError.cs | 13 ++++++++ Entities/Crowding.cs | 7 +++++ Entities/DisruptedRoute.cs | 27 +++++++++++++++++ Entities/Disruption.cs | 21 +++++++++++++ Entities/IIdentifiable.cs | 6 ++++ Entities/Identifier.cs | 11 +++++++ Entities/Interval.cs | 7 +++++ Entities/KnownJourney.cs | 10 +++++++ Entities/Line.cs | 24 +++++++++++++++ Entities/LineGroup.cs | 8 +++++ Entities/LineModeGroup.cs | 7 +++++ Entities/LineServiceTypeInfo.cs | 7 +++++ Entities/LineStatus.cs | 22 ++++++++++++++ Entities/MatchedRoute.cs | 27 +++++++++++++++++ Entities/MatchedStop.cs | 30 +++++++++++++++++++ Entities/Mode.cs | 18 +++++++++++ Entities/OrderedRoute.cs | 8 +++++ Entities/PassengerFlow.cs | 7 +++++ Entities/Period.cs | 11 +++++++ Entities/Place.cs | 23 ++++++++++++++ Entities/Point.cs | 7 +++++ Entities/RouteSection.cs | 25 ++++++++++++++++ Entities/RouteSectionNaptanEntrySequence.cs | 7 +++++ Entities/RouteSequence.cs | 21 +++++++++++++ Entities/Schedule.cs | 10 +++++++ Entities/SearchMatch.cs | 10 +++++++ Entities/ServiceFrequency.cs | 7 +++++ Entities/StationInterval.cs | 7 +++++ Entities/StopPoint.cs | 33 +++++++++++++++++++++ Entities/StopPointSequence.cs | 22 ++++++++++++++ Entities/Timetable.cs | 7 +++++ Entities/TimetableResponse.cs | 16 ++++++++++ Entities/TimetableRoute.cs | 7 +++++ Entities/Timetables/Disambiguation.cs | 6 ++++ Entities/Timetables/DisambiguationOption.cs | 7 +++++ Entities/TrainLoading.cs | 12 ++++++++ Entities/TwentyFourHourClockTime.cs | 9 ++++++ Enums/DisruptionCategory.cs | 12 ++++++++ Enums/ServiceType.cs | 7 +++++ Enums/TimetablePeriodType.cs | 9 ++++++ TFL.csproj | 9 ++++++ TFL.sln | 16 ++++++++++ 44 files changed, 572 insertions(+) create mode 100644 .gitignore create mode 100644 Entities/AdditionalProperties.cs create mode 100644 Entities/ApiError.cs create mode 100644 Entities/Crowding.cs create mode 100644 Entities/DisruptedRoute.cs create mode 100644 Entities/Disruption.cs create mode 100644 Entities/IIdentifiable.cs create mode 100644 Entities/Identifier.cs create mode 100644 Entities/Interval.cs create mode 100644 Entities/KnownJourney.cs create mode 100644 Entities/Line.cs create mode 100644 Entities/LineGroup.cs create mode 100644 Entities/LineModeGroup.cs create mode 100644 Entities/LineServiceTypeInfo.cs create mode 100644 Entities/LineStatus.cs create mode 100644 Entities/MatchedRoute.cs create mode 100644 Entities/MatchedStop.cs create mode 100644 Entities/Mode.cs create mode 100644 Entities/OrderedRoute.cs create mode 100644 Entities/PassengerFlow.cs create mode 100644 Entities/Period.cs create mode 100644 Entities/Place.cs create mode 100644 Entities/Point.cs create mode 100644 Entities/RouteSection.cs create mode 100644 Entities/RouteSectionNaptanEntrySequence.cs create mode 100644 Entities/RouteSequence.cs create mode 100644 Entities/Schedule.cs create mode 100644 Entities/SearchMatch.cs create mode 100644 Entities/ServiceFrequency.cs create mode 100644 Entities/StationInterval.cs create mode 100644 Entities/StopPoint.cs create mode 100644 Entities/StopPointSequence.cs create mode 100644 Entities/Timetable.cs create mode 100644 Entities/TimetableResponse.cs create mode 100644 Entities/TimetableRoute.cs create mode 100644 Entities/Timetables/Disambiguation.cs create mode 100644 Entities/Timetables/DisambiguationOption.cs create mode 100644 Entities/TrainLoading.cs create mode 100644 Entities/TwentyFourHourClockTime.cs create mode 100644 Enums/DisruptionCategory.cs create mode 100644 Enums/ServiceType.cs create mode 100644 Enums/TimetablePeriodType.cs create mode 100644 TFL.csproj create mode 100644 TFL.sln diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..31c6420 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +obj +.idea diff --git a/Entities/AdditionalProperties.cs b/Entities/AdditionalProperties.cs new file mode 100644 index 0000000..026524e --- /dev/null +++ b/Entities/AdditionalProperties.cs @@ -0,0 +1,10 @@ +namespace TFL.Entities; + +public class AdditionalProperties +{ + public string Category; + public string Key; + public string SourceSystemKey; + public string Value; + public DateTime? Modified; +} \ No newline at end of file diff --git a/Entities/ApiError.cs b/Entities/ApiError.cs new file mode 100644 index 0000000..7d26660 --- /dev/null +++ b/Entities/ApiError.cs @@ -0,0 +1,13 @@ +namespace TFL.Entities; + +public class ApiError +{ + public DateTime TimestampUtc; + public string Name; + public string ExceptionType; + public int HttpStatusCode; + public System.Net.HttpStatusCode HttpStatus; + public string RelativeUri; + public string Message; + public string DetailedMessage; +} \ No newline at end of file diff --git a/Entities/Crowding.cs b/Entities/Crowding.cs new file mode 100644 index 0000000..ce38a2c --- /dev/null +++ b/Entities/Crowding.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class Crowding +{ + public List PassengerFlows; + public List TrainLoadings; +} \ No newline at end of file diff --git a/Entities/DisruptedRoute.cs b/Entities/DisruptedRoute.cs new file mode 100644 index 0000000..9440a1e --- /dev/null +++ b/Entities/DisruptedRoute.cs @@ -0,0 +1,27 @@ +using System.Globalization; + +namespace TFL.Entities; + +public class DisruptedRoute : IIdentifiable +{ + public string Id; + public string LineId; + public string RouteCode; + public string Name; + public string LineString; + public string Direction; + public string OriginationName; + public string DestinationName; + public RouteSectionNaptanEntrySequence Via; + public bool? IsEntireRouteSection; + public DateTime? ValidTo; + public DateTime? ValidFrom; + public List RouteSectionNaptanEntrySequence; + + public Identifier ToIdentifier() => new() + { + Id = Id.ToString(CultureInfo.InvariantCulture), + Name = Name, + Type = nameof(RouteSection) + }; +} \ No newline at end of file diff --git a/Entities/Disruption.cs b/Entities/Disruption.cs new file mode 100644 index 0000000..d51642b --- /dev/null +++ b/Entities/Disruption.cs @@ -0,0 +1,21 @@ +using TFL.Enums; + +namespace TFL.Entities; + +public class Disruption +{ + public string Id; + public DisruptionCategory Category; + public string Type; + public string CategoryDescription; + public string Description; + public string Summary; + public string AdditionalInfo; + public DateTime Created; + public DateTime LastUpdate; + public List AffectedRoutes; + public List AffectedStops; + public bool IsBlocking; + public bool IsWholeLine; + public string ClosureText; +} \ No newline at end of file diff --git a/Entities/IIdentifiable.cs b/Entities/IIdentifiable.cs new file mode 100644 index 0000000..8ae1f0e --- /dev/null +++ b/Entities/IIdentifiable.cs @@ -0,0 +1,6 @@ +namespace TFL.Entities; + +public interface IIdentifiable +{ + Identifier ToIdentifier(); +} \ No newline at end of file diff --git a/Entities/Identifier.cs b/Entities/Identifier.cs new file mode 100644 index 0000000..a175f10 --- /dev/null +++ b/Entities/Identifier.cs @@ -0,0 +1,11 @@ +namespace TFL.Entities; + +public class Identifier +{ + public string Id; + public string Name; + public string Uri; + public string FullName; + public string Type; + public Crowding Crowding; +} \ No newline at end of file diff --git a/Entities/Interval.cs b/Entities/Interval.cs new file mode 100644 index 0000000..ee0aee4 --- /dev/null +++ b/Entities/Interval.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class Interval +{ + public string StopId; + public double TimeToArrival; +} \ No newline at end of file diff --git a/Entities/KnownJourney.cs b/Entities/KnownJourney.cs new file mode 100644 index 0000000..7f8f498 --- /dev/null +++ b/Entities/KnownJourney.cs @@ -0,0 +1,10 @@ +namespace TFL.Entities; + +public class KnownJourney +{ + public string Hour; + public string Minute; + public int IntervalId; + + public TimeSpan ToTimeSpan() => new(int.Parse(Hour), int.Parse(Minute), 0); +} \ No newline at end of file diff --git a/Entities/Line.cs b/Entities/Line.cs new file mode 100644 index 0000000..1dc2139 --- /dev/null +++ b/Entities/Line.cs @@ -0,0 +1,24 @@ +namespace TFL.Entities; + +public class Line : IIdentifiable +{ + public string Id; + public string Name; + public string ModeName; + public List Disruptions; + public DateTime Created; + public DateTime? Modified; + public List LineStatus; + public List RouteSections; + public List ServiceTypes; + public Crowding Crowding; + + public Identifier ToIdentifier() => new() + { + Id = Id, + Name = Name, + Type = nameof(Line), + Uri = $"/Line/{Id}", + Crowding = Crowding + }; +} \ No newline at end of file diff --git a/Entities/LineGroup.cs b/Entities/LineGroup.cs new file mode 100644 index 0000000..b258ad6 --- /dev/null +++ b/Entities/LineGroup.cs @@ -0,0 +1,8 @@ +namespace TFL.Entities; + +public class LineGroup +{ + public string NaptanIdReference; + public string StationAtcoCode; + public List LineIdentifier; +} \ No newline at end of file diff --git a/Entities/LineModeGroup.cs b/Entities/LineModeGroup.cs new file mode 100644 index 0000000..cf6e1cc --- /dev/null +++ b/Entities/LineModeGroup.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class LineModeGroup +{ + public string ModeName; + public List LineIdentifier; +} \ No newline at end of file diff --git a/Entities/LineServiceTypeInfo.cs b/Entities/LineServiceTypeInfo.cs new file mode 100644 index 0000000..fd914b5 --- /dev/null +++ b/Entities/LineServiceTypeInfo.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class LineServiceTypeInfo +{ + public string Name; + public string Uri; +} \ No newline at end of file diff --git a/Entities/LineStatus.cs b/Entities/LineStatus.cs new file mode 100644 index 0000000..0e1c919 --- /dev/null +++ b/Entities/LineStatus.cs @@ -0,0 +1,22 @@ +using System.Globalization; + +namespace TFL.Entities; + +public class LineStatus : IIdentifiable +{ + public string Id; + public string LineId; + public int? StatusSeverity; + public string StatusSeverityDescription; + public string Reason; + public DateTime Created; + public DateTime? Modified; + + public Identifier ToIdentifier() => new() + { + Id = Id.ToString(CultureInfo.InvariantCulture), + Name = $"{StatusSeverity} - {StatusSeverityDescription}", + Type = nameof(LineStatus), + Uri = $"/Line/{Id}/Status" + }; +} \ No newline at end of file diff --git a/Entities/MatchedRoute.cs b/Entities/MatchedRoute.cs new file mode 100644 index 0000000..f0a9378 --- /dev/null +++ b/Entities/MatchedRoute.cs @@ -0,0 +1,27 @@ +using System.Globalization; + +namespace TFL.Entities; + +public class MatchedRoute : IIdentifiable +{ + public string Id; + public string LineId; + public string RouteCode; + public string Name; + public string Direction; + public string OriginationName; + public string DestinationName; + public string Originator; + public string Destination; + public string ServiceType; + public DateTime? ValidTo; + public DateTime? ValidFrom; + + public Identifier ToIdentifier() => new() + { + Id = Id.ToString(CultureInfo.InvariantCulture), + Name = Name, + Type = nameof(MatchedRoute), + Uri = $"/MatchedRoute/{Id}" + }; +} \ No newline at end of file diff --git a/Entities/MatchedStop.cs b/Entities/MatchedStop.cs new file mode 100644 index 0000000..4df6378 --- /dev/null +++ b/Entities/MatchedStop.cs @@ -0,0 +1,30 @@ +namespace TFL.Entities; + +public class MatchedStop : SearchMatch, IIdentifiable, IComparable +{ + public int RouteId; + public string ParentId; + public string StationId; + public string IcsId; + public string TopMostParentId; + public string Direction; + public string Towards; + public List Modes; + public string StopType; + public string StopLetter; + public string Zone; + public string AccessibilitySummary; + public bool HasDisruption; + public List Lines; + public bool Status; + + public Identifier ToIdentifier() => new() + { + Id = Id, + Name = Name, + Type = nameof(StopPoint), + Uri = "/StopPoint/" + Id + }; + + public int CompareTo(MatchedStop? obj) => obj == null ? -1 : string.Compare(Name, obj.Name, StringComparison.Ordinal); +} \ No newline at end of file diff --git a/Entities/Mode.cs b/Entities/Mode.cs new file mode 100644 index 0000000..f9bc578 --- /dev/null +++ b/Entities/Mode.cs @@ -0,0 +1,18 @@ +using System.Globalization; + +namespace TFL.Entities; + +public class Mode : IIdentifiable +{ + public bool IsTflService; + public bool IsFarePaying; + public bool IsScheduledService; + public string ModeName; + + public Identifier ToIdentifier() => new() + { + Id = ModeName.ToString(CultureInfo.InvariantCulture), + Name = ModeName, + Type = nameof(Mode) + }; +} \ No newline at end of file diff --git a/Entities/OrderedRoute.cs b/Entities/OrderedRoute.cs new file mode 100644 index 0000000..bbdb688 --- /dev/null +++ b/Entities/OrderedRoute.cs @@ -0,0 +1,8 @@ +namespace TFL.Entities; + +public class OrderedRoute +{ + public string Name; + public List NaptanIds; + public string ServiceType; +} \ No newline at end of file diff --git a/Entities/PassengerFlow.cs b/Entities/PassengerFlow.cs new file mode 100644 index 0000000..7410ed8 --- /dev/null +++ b/Entities/PassengerFlow.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class PassengerFlow +{ + public string TimeSlice; + public int? Value; +} \ No newline at end of file diff --git a/Entities/Period.cs b/Entities/Period.cs new file mode 100644 index 0000000..0a2be39 --- /dev/null +++ b/Entities/Period.cs @@ -0,0 +1,11 @@ +using TFL.Enums; + +namespace TFL.Entities; + +public class Period +{ + public TimetablePeriodType Type; + public TwentyFourHourClockTime FromTime; + public TwentyFourHourClockTime ToTime; + public ServiceFrequency Frequency; +} \ No newline at end of file diff --git a/Entities/Place.cs b/Entities/Place.cs new file mode 100644 index 0000000..9e5d1f7 --- /dev/null +++ b/Entities/Place.cs @@ -0,0 +1,23 @@ +using System.Web; + +namespace TFL.Entities; + +public class Place : Point, IIdentifiable +{ + public string Id; + public string Url; + public string CommonName; + public double Distance; + public string PlaceType; + public List AdditionalProperties; + public List Children; + public List ChildrenUrls; + + public Identifier ToIdentifier() => new() + { + Id = Id, + Name = CommonName, + Type = nameof(Place), + Uri = $@"/Place/{HttpUtility.UrlEncode(Id)}" + }; +} \ No newline at end of file diff --git a/Entities/Point.cs b/Entities/Point.cs new file mode 100644 index 0000000..4bd7d50 --- /dev/null +++ b/Entities/Point.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class Point +{ + public double Lat; + public double Lon; +} \ No newline at end of file diff --git a/Entities/RouteSection.cs b/Entities/RouteSection.cs new file mode 100644 index 0000000..17765a5 --- /dev/null +++ b/Entities/RouteSection.cs @@ -0,0 +1,25 @@ +using System.Globalization; + +namespace TFL.Entities; + +public class RouteSection : IIdentifiable +{ + public string Id; + public string LineId; + public string RouteCode; + public string Name; + public string LineString; + public string Direction; + public string OriginationName; + public string DestinationName; + public DateTime? ValidTo; + public DateTime? ValidFrom; + public List RouteSectionNaptanEntrySequence; + + public Identifier ToIdentifier() => new() + { + Id = Id.ToString(CultureInfo.InvariantCulture), + Name = Name, + Type = nameof(RouteSection) + }; +} \ No newline at end of file diff --git a/Entities/RouteSectionNaptanEntrySequence.cs b/Entities/RouteSectionNaptanEntrySequence.cs new file mode 100644 index 0000000..7e5f82e --- /dev/null +++ b/Entities/RouteSectionNaptanEntrySequence.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class RouteSectionNaptanEntrySequence +{ + public int Ordinal; + public StopPoint StopPoint; +} \ No newline at end of file diff --git a/Entities/RouteSequence.cs b/Entities/RouteSequence.cs new file mode 100644 index 0000000..197eca1 --- /dev/null +++ b/Entities/RouteSequence.cs @@ -0,0 +1,21 @@ +namespace TFL.Entities; + +public class RouteSequence : IIdentifiable +{ + public string LineId; + public string LineName; + public string Direction; + public bool IsOutboundOnly; + public string Mode; + public List LineStrings; + public List Stations; + public List StopPointSequences; + public List OrderedLineRoutes; + + public Identifier ToIdentifier() => new() + { + Id = LineId, + Type = nameof(RouteSequence), + Uri = $"/Line/{LineId}/Route/Sequence/{Direction}" + }; +} \ No newline at end of file diff --git a/Entities/Schedule.cs b/Entities/Schedule.cs new file mode 100644 index 0000000..7285224 --- /dev/null +++ b/Entities/Schedule.cs @@ -0,0 +1,10 @@ +namespace TFL.Entities; + +public class Schedule +{ + public string Name; + public List KnownJourneys; + public KnownJourney FirstJourney; + public KnownJourney LastJourney; + public List Periods; +} \ No newline at end of file diff --git a/Entities/SearchMatch.cs b/Entities/SearchMatch.cs new file mode 100644 index 0000000..4872df1 --- /dev/null +++ b/Entities/SearchMatch.cs @@ -0,0 +1,10 @@ +namespace TFL.Entities; + +public class SearchMatch +{ + public string Id; + public string Url; + public string Name; + public double? Lat; + public double? Lon; +} \ No newline at end of file diff --git a/Entities/ServiceFrequency.cs b/Entities/ServiceFrequency.cs new file mode 100644 index 0000000..daeb5de --- /dev/null +++ b/Entities/ServiceFrequency.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class ServiceFrequency +{ + public double LowestFrequency; + public double HighestFrequency; +} \ No newline at end of file diff --git a/Entities/StationInterval.cs b/Entities/StationInterval.cs new file mode 100644 index 0000000..95f4488 --- /dev/null +++ b/Entities/StationInterval.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class StationInterval +{ + public string Id; + public List Intervals; +} \ No newline at end of file diff --git a/Entities/StopPoint.cs b/Entities/StopPoint.cs new file mode 100644 index 0000000..50e855b --- /dev/null +++ b/Entities/StopPoint.cs @@ -0,0 +1,33 @@ +namespace TFL.Entities; + +public class StopPoint : Place, IIdentifiable, IComparable +{ + public string NaptanId; + public string PlatformName; + public string Indicator; + public string StopLetter; + public List Modes; + public string IcsCode; + public string SMSCode; + public string StopType; + public string StationNaptan; + public string AccessibilitySummary; + public string HubNaptanCode; + public List Lines; + public List LineGroup; + public List LineModeGroups; + public string FullName; + public string NaptanMode; + public bool Status; + + public int CompareTo(StopPoint? obj) => obj == null ? -1 : string.Compare(CommonName, obj.CommonName, StringComparison.Ordinal); + + public new Identifier ToIdentifier() => new() + { + Id = NaptanId, + Name = CommonName, + Type = nameof(StopPoint), + Uri = $"/StopPoint/{NaptanId}", + FullName = FullName + }; +} \ No newline at end of file diff --git a/Entities/StopPointSequence.cs b/Entities/StopPointSequence.cs new file mode 100644 index 0000000..bcc5858 --- /dev/null +++ b/Entities/StopPointSequence.cs @@ -0,0 +1,22 @@ +using TFL.Enums; + +namespace TFL.Entities; + +public class StopPointSequence : IIdentifiable +{ + public string LineId; + public string LineName; + public string Direction; + public int BranchId; + public List NextBranchIds; + public List PrevBranchIds; + public List StopPoint; + public ServiceType ServiceType; + + public Identifier ToIdentifier() => new() + { + Id = LineId, + Type = nameof(StopPointSequence), + Uri = $"/Line/{LineId}/Route/Sequence/{Direction}" + }; +} \ No newline at end of file diff --git a/Entities/Timetable.cs b/Entities/Timetable.cs new file mode 100644 index 0000000..6b7ee84 --- /dev/null +++ b/Entities/Timetable.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class Timetable +{ + public string DepartureStopId; + public List Routes; +} \ No newline at end of file diff --git a/Entities/TimetableResponse.cs b/Entities/TimetableResponse.cs new file mode 100644 index 0000000..1eebd5b --- /dev/null +++ b/Entities/TimetableResponse.cs @@ -0,0 +1,16 @@ +using TFL.Entities.Timetables; + +namespace TFL.Entities; + +public class TimetableResponse +{ + public string LineId; + public string LineName; + public string Direction; + public string PdfUrl; + public List Stations; + public List Stops; + public Timetable Timetable; + public Disambiguation Disambiguation; + public string StatusErrorMessage; +} \ No newline at end of file diff --git a/Entities/TimetableRoute.cs b/Entities/TimetableRoute.cs new file mode 100644 index 0000000..3d11151 --- /dev/null +++ b/Entities/TimetableRoute.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities; + +public class TimetableRoute +{ + public List StationIntervals; + public List Schedules; +} \ No newline at end of file diff --git a/Entities/Timetables/Disambiguation.cs b/Entities/Timetables/Disambiguation.cs new file mode 100644 index 0000000..e17c6d5 --- /dev/null +++ b/Entities/Timetables/Disambiguation.cs @@ -0,0 +1,6 @@ +namespace TFL.Entities.Timetables; + +public class Disambiguation +{ + public List DisambiguationOptions; +} \ No newline at end of file diff --git a/Entities/Timetables/DisambiguationOption.cs b/Entities/Timetables/DisambiguationOption.cs new file mode 100644 index 0000000..25771a2 --- /dev/null +++ b/Entities/Timetables/DisambiguationOption.cs @@ -0,0 +1,7 @@ +namespace TFL.Entities.Timetables; + +public class DisambiguationOption +{ + public string Description; + public string Uri; +} \ No newline at end of file diff --git a/Entities/TrainLoading.cs b/Entities/TrainLoading.cs new file mode 100644 index 0000000..b804a04 --- /dev/null +++ b/Entities/TrainLoading.cs @@ -0,0 +1,12 @@ +namespace TFL.Entities; + +public class TrainLoading +{ + public string Line; + public string LineDirection; + public string PlatformDirection; + public string Direction; + public string NaptanTo; + public string TimeSlice; + public int? Value; +} \ No newline at end of file diff --git a/Entities/TwentyFourHourClockTime.cs b/Entities/TwentyFourHourClockTime.cs new file mode 100644 index 0000000..adc2b0b --- /dev/null +++ b/Entities/TwentyFourHourClockTime.cs @@ -0,0 +1,9 @@ +namespace TFL.Entities; + +public class TwentyFourHourClockTime +{ + public string Hour; + public string Minute; + + public TimeSpan ToTimeSpan() => new(int.Parse(Hour), int.Parse(Minute), 0); +} \ No newline at end of file diff --git a/Enums/DisruptionCategory.cs b/Enums/DisruptionCategory.cs new file mode 100644 index 0000000..6e2da9e --- /dev/null +++ b/Enums/DisruptionCategory.cs @@ -0,0 +1,12 @@ +namespace TFL.Enums; + +public enum DisruptionCategory +{ + Undefined, + RealTime, + PlannedWork, + Information, + Event, + Crowding, + StatusAlert +} \ No newline at end of file diff --git a/Enums/ServiceType.cs b/Enums/ServiceType.cs new file mode 100644 index 0000000..32f1512 --- /dev/null +++ b/Enums/ServiceType.cs @@ -0,0 +1,7 @@ +namespace TFL.Enums; + +public enum ServiceType +{ + Regular, + Night +} \ No newline at end of file diff --git a/Enums/TimetablePeriodType.cs b/Enums/TimetablePeriodType.cs new file mode 100644 index 0000000..dd61b75 --- /dev/null +++ b/Enums/TimetablePeriodType.cs @@ -0,0 +1,9 @@ +namespace TFL.Enums; + +public enum TimetablePeriodType +{ + Normal, + FrequencyHours, + FrequencyMinutes, + Unknown, +} \ No newline at end of file diff --git a/TFL.csproj b/TFL.csproj new file mode 100644 index 0000000..eb2460e --- /dev/null +++ b/TFL.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/TFL.sln b/TFL.sln new file mode 100644 index 0000000..572d736 --- /dev/null +++ b/TFL.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TFL", "TFL.csproj", "{56E575D0-549D-4E67-A084-C632DDA5F1E2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {56E575D0-549D-4E67-A084-C632DDA5F1E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56E575D0-549D-4E67-A084-C632DDA5F1E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56E575D0-549D-4E67-A084-C632DDA5F1E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56E575D0-549D-4E67-A084-C632DDA5F1E2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal