From 8c042a243e0ea0ffad860ece85f84cbd441900d1 Mon Sep 17 00:00:00 2001 From: Vapre Date: Sun, 3 Jul 2022 12:57:37 +0200 Subject: [PATCH] PathSearch, make TargetPredicate a readonly private field. --- OpenRA.Mods.Common/Pathfinder/PathSearch.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Pathfinder/PathSearch.cs b/OpenRA.Mods.Common/Pathfinder/PathSearch.cs index 2c661dcd3e..f4a92f752e 100644 --- a/OpenRA.Mods.Common/Pathfinder/PathSearch.cs +++ b/OpenRA.Mods.Common/Pathfinder/PathSearch.cs @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Pathfinder public IPathGraph Graph { get; } readonly Func heuristic; readonly int heuristicWeightPercentage; - public Func TargetPredicate { get; set; } + readonly Func targetPredicate; readonly IPriorityQueue openQueue; /// @@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Pathfinder Graph = graph; this.heuristic = heuristic; this.heuristicWeightPercentage = heuristicWeightPercentage; - TargetPredicate = targetPredicate; + this.targetPredicate = targetPredicate; openQueue = new PriorityQueue(GraphConnection.ConnectionCostComparer); } @@ -224,7 +224,7 @@ namespace OpenRA.Mods.Common.Pathfinder while (CanExpand()) { var p = Expand(); - if (TargetPredicate(p)) + if (targetPredicate(p)) return MakePath(Graph, p); }