This commit is contained in:
Cj 2024-06-12 19:42:16 -04:00
parent 56d0d3233d
commit ce86e9dd15
2 changed files with 8 additions and 8 deletions

View File

@ -20,7 +20,7 @@ internal class ScoringModel
internal static class ScoringModelExtensions internal static class ScoringModelExtensions
{ {
public static void AddModelToResult(this ScoringModel model) public static void AddScoreToResult(this ScoringModel model)
{ {
try try
{ {
@ -28,7 +28,7 @@ internal static class ScoringModelExtensions
{ {
foreach (var outVal in modelHashset) foreach (var outVal in modelHashset)
{ {
if (outVal.Definition.FullName == model.Definition.FullName) if (outVal.Definition.Name == model.Definition.Name)
{ {
Logger.Log("Skipping adding duplicate type match to list", ConsoleColor.Yellow); Logger.Log("Skipping adding duplicate type match to list", ConsoleColor.Yellow);
return; return;

View File

@ -192,7 +192,7 @@ internal class Remapper
return EFailureReason.HasNestedTypes; return EFailureReason.HasNestedTypes;
} }
ScoringModelExtensions.AddModelToResult(score); score.AddScoreToResult();
return EFailureReason.None; return EFailureReason.None;
} }
@ -222,13 +222,13 @@ internal class Remapper
private void ChooseBestMatch(HashSet<ScoringModel> scores, bool isBest = false) private void ChooseBestMatch(HashSet<ScoringModel> scores, bool isBest = false)
{ {
if (DataProvider.ScoringModels.Count == 0) if (scores.Count == 0)
{ {
return; return;
} }
var highestScore = scores.OrderByDescending(model => model.Score).FirstOrDefault(); var highestScore = scores.OrderByDescending(score => score.Score).FirstOrDefault();
var nextHighestScores = scores.OrderByDescending(model => model.Score).Skip(1); var nextHighestScores = scores.OrderByDescending(score => score.Score).Skip(1);
if (highestScore is null) { return; } if (highestScore is null) { return; }
@ -243,9 +243,9 @@ internal class Remapper
if (scores.Count > 1) if (scores.Count > 1)
{ {
Logger.Log($"Warning! There were {scores.Count} possible matches. Considering adding more search parameters", ConsoleColor.Yellow); Logger.Log($"Warning! There were {scores.Count - 1} possible matches. Considering adding more search parameters", ConsoleColor.Yellow);
foreach (var score in scores) foreach (var score in scores.OrderByDescending(score => score.Score).Skip(1))
{ {
Logger.Log($"{score.Definition.Name} - Score [{score.Score}]", ConsoleColor.Yellow); Logger.Log($"{score.Definition.Name} - Score [{score.Score}]", ConsoleColor.Yellow);
} }