Class DepartureRange
- Namespace
- EncDotNet.S100.Navigation
- Assembly
- EncDotNet.S100.Navigation.dll
The departures a clearance check sweeps (DepartureWindow): a fixed range, or the span of the water-level data that covers the route.
public sealed record DepartureRange : IEquatable<DepartureRange>
- Inheritance
-
DepartureRange
- Implements
- Inherited Members
Properties
FollowsWaterLevelData
Whether the range follows the water-level data rather than fixed times.
public bool FollowsWaterLevelData { get; }
Property Value
From
The first departure, or null to follow the water-level data.
public DateTimeOffset? From { get; }
Property Value
MaxDepartures
The most departures to evaluate when following the water-level data; a longer span widens the step.
public int MaxDepartures { get; }
Property Value
Step
The time between departures.
public TimeSpan Step { get; }
Property Value
To
The last departure (inclusive), or null to follow the water-level data.
public DateTimeOffset? To { get; }
Property Value
Methods
Between(DateTimeOffset, DateTimeOffset, TimeSpan)
Every step from from to to.
public static DepartureRange Between(DateTimeOffset from, DateTimeOffset to, TimeSpan step)
Parameters
fromDateTimeOffsetThe first departure.
toDateTimeOffsetThe last departure (inclusive).
stepTimeSpanThe time between departures; must be positive.
Returns
- DepartureRange
The range.
WaterLevelData(TimeSpan, int)
Every step across the water-level data that covers
the route: from the first whole step (counted from midnight UTC) at or
after the data starts to the data's end. Departures whose arrival falls
after the data ends get WaterLevelEndsBeforeArrival.
When the range would need more than maxDepartures
departures, the step widens to the smallest multiple of
step that fits, so a long forecast stays cheap.
public static DepartureRange WaterLevelData(TimeSpan step, int maxDepartures = 2000)
Parameters
stepTimeSpanThe time between departures; must be positive.
maxDeparturesintThe most departures to evaluate; must be at least 1.
Returns
- DepartureRange
The range.