BetterPartyFinder/BetterPartyFinder/Util.cs

30 lines
929 B
C#
Executable File

using System.Globalization;
using System.Linq;
using Dalamud.Data;
using Lumina.Excel.GeneratedSheets;
namespace BetterPartyFinder {
public static class Util {
internal static uint MaxItemLevel { get; private set; }
internal static void CalculateMaxItemLevel(DataManager data) {
if (MaxItemLevel > 0) {
return;
}
var max = data.GetExcelSheet<Item>()
.Where(item => item.EquipSlotCategory.Value.Body != 0)
.Select(item => item.LevelItem.Value?.RowId)
.Where(level => level != null)
.Cast<uint>()
.Max();
MaxItemLevel = max;
}
internal static bool ContainsIgnoreCase(this string haystack, string needle) {
return CultureInfo.InvariantCulture.CompareInfo.IndexOf(haystack, needle, CompareOptions.IgnoreCase) >= 0;
}
}
}