| | | 1 | | using Itinero.Network.Enumerators.Edges; |
| | | 2 | | |
| | | 3 | | namespace Itinero.Network.Search.Islands; |
| | | 4 | | |
| | | 5 | | internal static class IslandsExtensions |
| | | 6 | | { |
| | | 7 | | public static bool? IsEdgeOnIsland(this Islands islands, IEdgeEnumerator e, uint tileNotDone = uint.MaxValue) |
| | 0 | 8 | | { |
| | 0 | 9 | | var onIsland = islands.IsEdgeOnIsland(e.EdgeId); |
| | 0 | 10 | | if (onIsland) return true; |
| | | 11 | | |
| | 0 | 12 | | var t = e.Tail.TileId; |
| | 0 | 13 | | if (!e.Forward) t = e.Head.TileId; |
| | | 14 | | |
| | 0 | 15 | | if (t == tileNotDone) return null; |
| | 0 | 16 | | if (!islands.GetTileDone(t)) return null; |
| | | 17 | | |
| | | 18 | | // tile is done, we are sure this edge is not on an island. |
| | 0 | 19 | | return false; |
| | 0 | 20 | | } |
| | | 21 | | } |