This repository has been archived on 2025-01-15. You can view files and clone it, but cannot push or open issues or pull requests.
Files
OSMServer/OSMDatastructure/Region.cs
2023-02-06 17:32:55 +01:00

26 lines
608 B
C#

namespace OSMDatastructure;
public class Region
{
public const float regionSize = 0.01f;
public readonly HashSet<OsmNode> nodes = new();
public ulong regionHash { get; }
public Region(ulong regionHash)
{
this.regionHash = regionHash;
}
public Region(Coordinates regionCoordinates)
{
this.regionHash = regionCoordinates.GetRegionHash();
}
public OsmNode? GetNode(Coordinates coordinates)
{
foreach(OsmNode node in this.nodes)
if (node.coordinates.Equals(coordinates))
return node;
return null;
}
}