Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Triky313 committed Dec 5, 2024
2 parents 6c0dc15 + 3e19aa3 commit 9c3ba96
Show file tree
Hide file tree
Showing 31 changed files with 1,809 additions and 296 deletions.
18 changes: 16 additions & 2 deletions src/StatisticsAnalysisTool/Common/ItemController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public static int GetItemLevel(string uniqueName)
return int.TryParse(uniqueName.Split('@')[1], out var number) ? number : 0;
}

public static int GetItemTier(Item item)
public static int GetItemTier(string uniqueName)
{
var itemNameTierText = item?.UniqueName?.Split('_')[0];
var itemNameTierText = uniqueName?.Split('_')[0];
if (itemNameTierText != null && itemNameTierText[..1] == "T" && int.TryParse(itemNameTierText.AsSpan(1, 1), out var result))
{
return result;
Expand All @@ -75,6 +75,20 @@ public static int GetItemTier(Item item)
return -1;
}

public static Item GetItemByLocalizedName(string itemName, int enchantment)
{
var matchingItems = Items.Where(item =>
item.LocalizedNames != null &&
typeof(LocalizedNames).GetProperties().Any(property =>
{
var value = property.GetValue(item.LocalizedNames) as string;
return string.Equals(value, itemName, StringComparison.OrdinalIgnoreCase);
})
).ToList();

return matchingItems.FirstOrDefault(item => item.Level == enchantment);
}

#endregion

#region Item value
Expand Down
3 changes: 1 addition & 2 deletions src/StatisticsAnalysisTool/Dungeon/DungeonMapping.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using StatisticsAnalysisTool.Cluster;
using StatisticsAnalysisTool.Dungeon.Models;
using StatisticsAnalysisTool.Dungeon.Models;
using StatisticsAnalysisTool.Enumerations;
using StatisticsAnalysisTool.Exceptions;
using System.Linq;
Expand Down
174 changes: 0 additions & 174 deletions src/StatisticsAnalysisTool/EventLogging/LoggerBindings.cs

This file was deleted.

Loading

0 comments on commit 9c3ba96

Please sign in to comment.