33 lines
741 B
C#
33 lines
741 B
C#
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();
|
|
}
|
|
} |