From a9186d8b68285b3081a8c6866a1a40fcfd0fd7a4 Mon Sep 17 00:00:00 2001 From: madc0der Date: Sun, 3 Apr 2022 23:47:55 +0300 Subject: [PATCH] Support forceInit for all ERPathAdapters at MultiRoadPathCreator --- ERVertexPath/ERMultiRoadPathCreator.cs | 2 +- ERVertexPath/ERNetworkVertexPathCreator.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ERVertexPath/ERMultiRoadPathCreator.cs b/ERVertexPath/ERMultiRoadPathCreator.cs index 00497b6..9e6fccf 100644 --- a/ERVertexPath/ERMultiRoadPathCreator.cs +++ b/ERVertexPath/ERMultiRoadPathCreator.cs @@ -34,7 +34,7 @@ namespace ERVertexPath isInitialized = true; - allRoadsPathCreator.Init(); + allRoadsPathCreator.Init(forceInit); var lowerNameMask = roadNameMask.ToLower(); var roads = new ERRoadNetwork().GetRoads().Where(_road => _road.GetName().ToLower().Contains(lowerNameMask)); diff --git a/ERVertexPath/ERNetworkVertexPathCreator.cs b/ERVertexPath/ERNetworkVertexPathCreator.cs index 449638b..c2efc42 100644 --- a/ERVertexPath/ERNetworkVertexPathCreator.cs +++ b/ERVertexPath/ERNetworkVertexPathCreator.cs @@ -19,9 +19,9 @@ namespace ERVertexPath Init(); } - public void Init() + public void Init(bool forceInit = false) { - if (isInitialized) + if (!forceInit && isInitialized) { return; }