| | | 1 | | namespace Itinero.Instructions.Types.Generators; |
| | | 2 | | |
| | | 3 | | internal class BaseInstructionGenerator : IInstructionGenerator |
| | | 4 | | { |
| | 13 | 5 | | public string Name { get; } = "base"; |
| | | 6 | | |
| | | 7 | | public BaseInstruction? Generate(IndexedRoute route, int offset) |
| | 18 | 8 | | { |
| | 18 | 9 | | if (offset + 1 >= route.Last) |
| | 3 | 10 | | { |
| | | 11 | | // The current offset is already the last index of the shape; this is the endpoint |
| | 3 | 12 | | return null; |
| | | 13 | | } |
| | | 14 | | |
| | | 15 | | // We are on the end of segment 'offset', what should we do next? |
| | 15 | 16 | | return new BaseInstruction(route, offset, route.DirectionChangeAt(offset + 1)); |
| | 18 | 17 | | } |
| | | 18 | | } |