Removed unnessecary inheritance

This commit is contained in:
C9Glax 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)

View File

@ -6,8 +6,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSMDatastructure", "OSMData
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pathfinding", "Pathfinding\Pathfinding.csproj", "{D4AA1C47-98D4-415C-B026-3BC25B6B6F9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Geo-Graph", "..\Geo-Graph\Geo-Graph\Geo-Graph.csproj", "{2F3E2E4A-6C1E-46AF-AC2C-62E5D4E317A0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -26,9 +24,5 @@ Global
{D4AA1C47-98D4-415C-B026-3BC25B6B6F9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4AA1C47-98D4-415C-B026-3BC25B6B6F9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4AA1C47-98D4-415C-B026-3BC25B6B6F9D}.Release|Any CPU.Build.0 = Release|Any CPU
{2F3E2E4A-6C1E-46AF-AC2C-62E5D4E317A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F3E2E4A-6C1E-46AF-AC2C-62E5D4E317A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F3E2E4A-6C1E-46AF-AC2C-62E5D4E317A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F3E2E4A-6C1E-46AF-AC2C-62E5D4E317A0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal