OSMServer/Importer/Region.cs

33 lines
741 B
C#
Raw Normal View History

2023-02-02 19:03:00 +01:00
namespace OSMServer;
public class Region
{
private Dictionary<ulong, Node> nodesInRegion = new Dictionary<ulong, Node>();
public uint regionHash;
public Region(uint regionHash)
{
this.regionHash = this.regionHash;
}
public Region(Coordinates regionCoordinates)
{
this.regionHash = regionCoordinates.GetRegionHash();
}
public Region(ulong nodeId, Node firstNode)
{
this.regionHash = firstNode.GetRegionHash();
this.nodesInRegion.Add(nodeId, firstNode);
}
public void AddNode(ulong nodeId, Node node)
{
this.nodesInRegion.Add(nodeId, node);
}
public Node[] GetNodes()
{
return this.nodesInRegion.Values.ToArray();
}
}