| | 1 | | // ReSharper disable UnusedAutoPropertyAccessor.Global |
| | 2 | | // ReSharper disable MemberCanBePrivate.Global |
| | 3 | | namespace Itinero.Instructions.Types; |
| | 4 | |
|
| | 5 | | /// <summary> |
| | 6 | | /// A roundabout instruction. |
| | 7 | | /// </summary> |
| | 8 | | public class RoundaboutInstruction : BaseInstruction |
| | 9 | | { |
| | 10 | | public RoundaboutInstruction( |
| | 11 | | IndexedRoute route, |
| | 12 | | int shapeIndex, |
| | 13 | | int shapeIndexEnd, |
| | 14 | | int turnDegrees, |
| | 15 | | int exitNumber, |
| 7 | 16 | | bool exitIsOnTheInside = false) : base(route, shapeIndex, shapeIndexEnd, turnDegrees) |
| 7 | 17 | | { |
| 7 | 18 | | this.ExitNumber = exitNumber; |
| 7 | 19 | | this.ExitIsOnTheInside = exitIsOnTheInside; |
| 7 | 20 | | } |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// True when the exit leads to the inside of the roundabout. |
| | 24 | | /// </summary> |
| | 25 | | /// <remarks> |
| | 26 | | /// Example: https://www.openstreetmap.org/directions?engine=graphhopper_car&route=50.94569%2C3.15129%3B50.94636%2C3 |
| | 27 | | /// </remarks> |
| 10 | 28 | | public bool ExitIsOnTheInside { get; } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// The number of the exit to take (one-based). |
| | 32 | | /// </summary> |
| 14 | 33 | | public int ExitNumber { get; } |
| | 34 | |
|
| | 35 | | // |
| | 36 | | // public override string ToString() |
| | 37 | | // { |
| | 38 | | // return $"Take the roundabout to go {TurnDegrees.DegreesToText()} via the {ExitNumber + 1}th exit." |
| | 39 | | // + (ExitIsOnTheInside ? "WARNING: this exit is on the inner side of the roundabout!" : ""); |
| | 40 | | // } |
| | 41 | | } |