29 lines
778 B
C#
29 lines
778 B
C#
|
namespace OSMImporter
|
||
|
{
|
||
|
public class Region
|
||
|
{
|
||
|
private readonly Dictionary<ulong, Node> _nodesInRegion = new Dictionary<ulong, Node>();
|
||
|
public ulong regionHash { get; }
|
||
|
|
||
|
public Region(Coordinates regionCoordinates)
|
||
|
{
|
||
|
this.regionHash = regionCoordinates.GetRegionHash();
|
||
|
}
|
||
|
|
||
|
public Region(ulong nodeId, Node firstNode)
|
||
|
{
|
||
|
this.regionHash = firstNode.GetRegionHash();
|
||
|
this._nodesInRegion.Add(nodeId, value: firstNode);
|
||
|
}
|
||
|
|
||
|
public void AddNode(ulong nodeId, Node node)
|
||
|
{
|
||
|
this._nodesInRegion.Add(nodeId, value: node);
|
||
|
}
|
||
|
|
||
|
public Node[] GetNodes()
|
||
|
{
|
||
|
return this._nodesInRegion.Values.ToArray();
|
||
|
}
|
||
|
}
|
||
|
}
|