Update to include direction of connection/edge
This commit is contained in:
parent
a0418a6fae
commit
64bb5259a8
@ -63,13 +63,11 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo
|
|||||||
ulong node2Id = w.NodeIds[i];
|
ulong node2Id = w.NodeIds[i];
|
||||||
if (ret.Nodes.TryGetValue(node1Id, out Graph.Node? node1))
|
if (ret.Nodes.TryGetValue(node1Id, out Graph.Node? node1))
|
||||||
{
|
{
|
||||||
//TODO add oneway checks
|
node1.Neighbors.TryAdd(node2Id, new(w.ID, true));
|
||||||
node1.Neighbors.TryAdd(node2Id, w.ID);
|
|
||||||
}
|
}
|
||||||
if (ret.Nodes.TryGetValue(node2Id, out Graph.Node? node2))
|
if (ret.Nodes.TryGetValue(node2Id, out Graph.Node? node2))
|
||||||
{
|
{
|
||||||
//TODO add oneway checks
|
node2.Neighbors.TryAdd(node1Id, new(w.ID, false));
|
||||||
node2.Neighbors.TryAdd(node1Id, w.ID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,6 +133,6 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo
|
|||||||
public Graph.Graph? LoadRegionFromCoordinates(float lat, float lon)
|
public Graph.Graph? LoadRegionFromCoordinates(float lat, float lon)
|
||||||
{
|
{
|
||||||
logger?.LogDebug($"Loading Region for Coordinates {lat} {lon}");
|
logger?.LogDebug($"Loading Region for Coordinates {lat} {lon}");
|
||||||
return LoadRegionFromRegionId(Utils.RegionUtils.GetRegionIdFromCoordinates(lat, lon, regionSize));
|
return LoadRegionFromRegionId(Utils.RegionUtils.GetRegionIdFromCoordinates(lat, lon, RegionSize));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user