| | 1 | | namespace Itinero.Instructions.Types; |
| | 2 | |
|
| | 3 | | public class EndInstruction : BaseInstruction |
| | 4 | | { |
| | 5 | | /// <summary> |
| | 6 | | /// The distance between the actual start point and the snapped start point on the road |
| | 7 | | /// </summary> |
| | 8 | | public readonly uint ProjectionDistance; |
| | 9 | |
|
| | 10 | | /// <summary> |
| | 11 | | /// The 'endInstruction' represents the projection from the actual endpoint (e.g. an adress) to the snapped point on |
| | 12 | | /// It doesn't really have an associated segment. |
| | 13 | | /// </summary> |
| | 14 | | /// <param name="route"></param> |
| | 15 | | /// <param name="turnDegrees"></param> |
| | 16 | | /// <param name="projectionDistance"></param> |
| | 17 | | /// <param name="index"></param> |
| | 18 | | /// <param name="indexEnd"></param> |
| | 19 | | public EndInstruction(IndexedRoute route, int turnDegrees, uint projectionDistance, int index, int indexEnd) : |
| 12 | 20 | | base(route, index, indexEnd, turnDegrees) |
| 12 | 21 | | { |
| 12 | 22 | | ProjectionDistance = projectionDistance; |
| 12 | 23 | | } |
| | 24 | |
|
| | 25 | |
|
| 12 | 26 | | public EndInstruction(IndexedRoute route) : this( |
| 12 | 27 | | route, |
| 12 | 28 | | 0, |
| 12 | 29 | | 0, |
| 12 | 30 | | route.Shape.Count - 2, |
| 12 | 31 | | route.Shape.Count - 1) |
| 24 | 32 | | { } |
| | 33 | |
|
| | 34 | | public override string ToString() |
| 0 | 35 | | { |
| 0 | 36 | | return $"Your destination lies {ProjectionDistance}m away from the road"; |
| 0 | 37 | | } |
| | 38 | | } |