AStar/Graph/Node.cs
2022-11-13 14:59:06 +01:00

26 lines
520 B
C#

namespace Graph
{
public class Node
{
public float lat { get; }
public float lon { get; }
public HashSet<Edge> edges { get; }
public Node(float lat, float lon)
{
this.lat = lat;
this.lon = lon;
this.edges = new();
}
public Edge? GetEdgeToNode(Node n)
{
foreach (Edge e in this.edges)
if (e.neighbor == n)
return e;
return null;
}
}
}