Split into Datastructure, Added ByteConverter, Full Split & Load
This commit is contained in:
35
OSMDatastructure/Region.cs
Normal file
35
OSMDatastructure/Region.cs
Normal file
@ -0,0 +1,35 @@
|
||||
namespace OSMDatastructure
|
||||
{
|
||||
public class Region
|
||||
{
|
||||
private readonly Dictionary<ulong, Node> _nodesInRegion = new();
|
||||
public ulong regionHash { get; }
|
||||
|
||||
public Region(Coordinates regionCoordinates, float regionSize)
|
||||
{
|
||||
this.regionHash = regionCoordinates.GetRegionHash(regionSize);
|
||||
}
|
||||
|
||||
public Region(ulong nodeId, Node firstNode, float regionSize)
|
||||
{
|
||||
this.regionHash = firstNode.GetRegionHash(regionSize);
|
||||
this._nodesInRegion.Add(nodeId, value: firstNode);
|
||||
}
|
||||
|
||||
public Region(ulong regionHash)
|
||||
{
|
||||
this.regionHash = regionHash;
|
||||
}
|
||||
|
||||
public void AddNode(ulong nodeId, Node node)
|
||||
{
|
||||
this._nodesInRegion.Add(nodeId, value: node);
|
||||
}
|
||||
|
||||
public Dictionary<ulong, Node> GetNodes()
|
||||
{
|
||||
return this._nodesInRegion;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user