| | | 1 | | using System.Collections.Generic; |
| | | 2 | | using OsmSharp; |
| | | 3 | | |
| | | 4 | | namespace Itinero.IO.Osm.Restrictions.Barriers; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Represents an OSM barrier. |
| | | 8 | | /// </summary> |
| | | 9 | | public class OsmBarrier |
| | | 10 | | { |
| | 2378 | 11 | | private OsmBarrier(Node node, IEnumerable<Way> ways) |
| | 2378 | 12 | | { |
| | 2378 | 13 | | this.Node = node; |
| | 2378 | 14 | | this.Ways = ways; |
| | 2378 | 15 | | } |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// The node where the barrier exists. |
| | | 19 | | /// </summary> |
| | 9279 | 20 | | public Node Node { get; } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// The way(s). |
| | | 24 | | /// </summary> |
| | 9279 | 25 | | public IEnumerable<Way> Ways { get; private set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Creates a new barrier. |
| | | 29 | | /// </summary> |
| | | 30 | | /// <param name="node">The node.</param> |
| | | 31 | | /// <param name="ways">The ways that contain the node.</param> |
| | | 32 | | /// <returns>The barrier.</returns> |
| | | 33 | | public static OsmBarrier Create(Node node, IEnumerable<Way> ways) |
| | 2378 | 34 | | { |
| | 2378 | 35 | | return new OsmBarrier(node, ways); |
| | 2378 | 36 | | } |
| | | 37 | | } |