Removed unnessecary inheritance

This commit is contained in:
2023-02-07 23:52:23 +01:00
parent e265c56bce
commit 0a9d5cfdfb
3 changed files with 8 additions and 17 deletions

View File

@ -1,5 +1,4 @@
using System.Text;
using GeoGraph;
namespace OSMDatastructure;
@ -246,7 +245,7 @@ public static class ByteConverter
switch (tagType)
{
case OsmEdge.tagType.highway:
return new KeyValuePair<OsmEdge.tagType, object>(tagType, (Way.wayType)content[0]);
return new KeyValuePair<OsmEdge.tagType, object>(tagType, (OsmEdge.wayType)content[0]);
case OsmEdge.tagType.maxspeed:
return new KeyValuePair<OsmEdge.tagType, object>(tagType, content[0]);
case OsmEdge.tagType.oneway:

View File

@ -1,26 +1,24 @@
using GeoGraph;
namespace OSMDatastructure;
public class OsmNode : Node
public class OsmNode
{
public new HashSet<OsmEdge> edges { get; }
public HashSet<OsmEdge> edges { get; }
public Coordinates coordinates { get; }
public OsmNode previousPathNode = null;
public OsmNode? previousPathNode = null;
public double currentPathWeight = double.MaxValue;
public double DirectDistanceToGoal = double.MaxValue;
public double directDistanceToGoal = double.MaxValue;
public OsmNode(float lat, float lon) : base(lat, lon)
public OsmNode(float lat, float lon)
{
this.edges = new();
this.coordinates = new Coordinates(lat, lon);
}
public OsmNode(Coordinates coordinates) : base(coordinates.latitude, coordinates.longitude)
public OsmNode(Coordinates coordinates)
{
this.edges = new();
this.coordinates = new Coordinates(lat, lon);
this.coordinates = coordinates;
}
public OsmEdge? GetEdgeToNode(OsmNode n)