Added GetNode(Coordinates coordinates)
Added GetNode(ulong id) Instead of returning null in LoadRegion now throw an exception when file is not found. Added some Method descriptors
This commit is contained in:
@ -2,7 +2,7 @@ namespace OSMDatastructure
|
||||
{
|
||||
public class Region
|
||||
{
|
||||
public const float regionSize = 0.01f;
|
||||
public const float regionSize = 0.01f; //For Splitting
|
||||
private readonly Dictionary<ulong, Node> _nodesInRegion = new();
|
||||
public ulong regionHash { get; }
|
||||
|
||||
@ -36,6 +36,16 @@ namespace OSMDatastructure
|
||||
{
|
||||
return this._nodesInRegion.ContainsKey(id) ? this._nodesInRegion[id] : null;
|
||||
}
|
||||
|
||||
|
||||
public Node? GetNode(Coordinates coordinates)
|
||||
{
|
||||
foreach (Node node in this._nodesInRegion.Values)
|
||||
{
|
||||
if (node.Equals(coordinates))
|
||||
return node;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user