/// <summary> /// Returns true if this position has stops. /// </summary> public static bool HasStops(this RoutePosition position) { return(position.Route.Stops != null && position.Route.Stops.Count > position.StopIndex && position.Route.Stops[position.StopIndex].Shape == position.Shape); }
/// <summary> /// Returns the stops at this position. /// </summary> public static IEnumerable <Route.Stop> Stops(this RoutePosition position) { throw new NotImplementedException(); }
/// <summary> /// Gets the relative direction at this position. /// </summary> public static RelativeDirection RelativeDirection(this RoutePosition position) { return(position.Route.RelativeDirectionAt(position.Shape)); }
/// <summary> /// Gets the direction at this position. /// </summary> public static DirectionEnum Direction(this RoutePosition position) { return(DirectionCalculator.Calculate(position.Location(), position.NextLocation())); }
/// <summary> /// Gets the location. /// </summary> public static Coordinate Location(this RoutePosition position) { return(position.Route.Shape[position.Shape]); }
/// <summary> /// Returns true if this position is the last position. /// </summary> public static bool IsLast(this RoutePosition position) { return(position.Route.Shape.Length - 1 == position.Shape); }
/// <summary> /// Returns true if this position is the first position. /// </summary> public static bool IsFirst(this RoutePosition position) { return(position.Shape == 0); }
/// <summary> /// Returns true if this position has current meta. /// </summary> public static bool HasCurrentMeta(this RoutePosition position) { return(position.Route.ShapeMeta != null && position.Route.ShapeMeta.Length > position.MetaIndex && position.Route.ShapeMeta[position.MetaIndex].Shape == position.Shape); }
/// <summary> /// Returns true if this position has branches. /// </summary> public static bool HasBranches(this RoutePosition position) { return(position.Route.Branches != null && position.Route.Branches.Length > position.BranchIndex && position.Route.Branches[position.BranchIndex].Shape == position.Shape); }