2022-05-05 16:12:40 +02:00
|
|
|
|
namespace Graph
|
2022-05-05 15:49:28 +02:00
|
|
|
|
{
|
2022-05-06 00:02:28 +02:00
|
|
|
|
public class Node
|
2022-05-05 15:49:28 +02:00
|
|
|
|
{
|
|
|
|
|
public float lat { get; }
|
|
|
|
|
public float lon { get; }
|
2022-05-06 00:02:28 +02:00
|
|
|
|
|
2022-11-13 14:02:27 +01:00
|
|
|
|
public HashSet<Edge> edges { get; }
|
2022-05-06 00:31:26 +02:00
|
|
|
|
|
2022-11-13 14:59:06 +01:00
|
|
|
|
public Node(float lat, float lon)
|
2022-05-05 15:49:28 +02:00
|
|
|
|
{
|
|
|
|
|
this.lat = lat;
|
|
|
|
|
this.lon = lon;
|
2022-10-31 23:10:28 +01:00
|
|
|
|
this.edges = new();
|
2022-11-03 19:13:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-03 19:35:04 +01:00
|
|
|
|
public Edge? GetEdgeToNode(Node n)
|
2022-11-03 19:13:38 +01:00
|
|
|
|
{
|
|
|
|
|
foreach (Edge e in this.edges)
|
|
|
|
|
if (e.neighbor == n)
|
|
|
|
|
return e;
|
|
|
|
|
return null;
|
2022-05-05 15:49:28 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|