From 5a1dce98836f0504fd12e3e317a0b1ec7b19b975 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 20 Apr 2023 19:37:34 +0200 Subject: [PATCH] PathResult now only includes Path and calcTime. Other fields have been moved to Pathfinder --- Pathfinding/PathResult.cs | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/Pathfinding/PathResult.cs b/Pathfinding/PathResult.cs index 19b1141..a0ebd63 100644 --- a/Pathfinding/PathResult.cs +++ b/Pathfinding/PathResult.cs @@ -1,5 +1,4 @@ using System.Text.Json.Serialization; -using OSMDatastructure.Graph; namespace Pathfinding; @@ -7,41 +6,11 @@ public class PathResult { [JsonInclude]public TimeSpan calcTime; [JsonInclude]public List pathNodes; - [JsonInclude]public Dictionary? gScore; - [JsonInclude]public HashSet? gScoreNodes; - [JsonIgnore] public RegionManager? regionManager { get; set; } - public string? name { get; set; } - - [JsonConstructor] - public PathResult(TimeSpan calcTime, List pathNodes, Dictionary? gScore, HashSet? gScoreNodes) - { - this.calcTime = calcTime; - this.pathNodes = pathNodes; - this.gScore = gScore; - this.gScoreNodes = gScoreNodes; - } + [JsonConstructor] public PathResult(TimeSpan calcTime, List pathNodes) { this.calcTime = calcTime; this.pathNodes = pathNodes; } - - public PathResult(TimeSpan calcTime, List pathNodes, Dictionary gScore) - { - this.calcTime = calcTime; - this.pathNodes = pathNodes; - AddGScores(gScore); - } - - public void AddGScores(Dictionary gScore) - { - this.gScore = new(); - this.gScoreNodes = new(); - foreach (KeyValuePair kv in gScore) - { - this.gScore.Add(kv.Key.nodeId, kv.Value); - this.gScoreNodes.Add(kv.Key); - } - } } \ No newline at end of file