Added Distance
This commit is contained in:
parent
4930423cb5
commit
b88e1a8dfc
@ -1,22 +1,18 @@
|
|||||||
namespace Graph
|
namespace Graph
|
||||||
{
|
{
|
||||||
public struct Edge
|
public class Edge
|
||||||
{
|
{
|
||||||
public ulong id { get; }
|
public ulong id { get; }
|
||||||
public Node neighbor { get; }
|
public Node neighbor { get; }
|
||||||
public float weight { get; }
|
public float time { get; }
|
||||||
public Edge(Node neighbor, float weight)
|
public float distance { get; }
|
||||||
{
|
|
||||||
this.neighbor = neighbor;
|
|
||||||
this.weight = weight;
|
|
||||||
this.id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Edge(Node neighbor, float weight, ulong id)
|
public Edge(Node neighbor, float time, float distance, ulong? id)
|
||||||
{
|
{
|
||||||
this.neighbor = neighbor;
|
this.neighbor = neighbor;
|
||||||
this.weight = weight;
|
this.time = time;
|
||||||
this.id = id;
|
this.distance = distance;
|
||||||
|
this.id = (id != null) ? id.Value : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user