Dalamud/Dalamud/Data/LuminaUtils.cs
Asriel Camora 0b9af0e3f4
Update to Lumina 5 (new Excel parsing) (#2022)
* Refactor and upgrade to new excel design

* Obsolete ExcelResolver<T> and use only RowRef<T>

* Better benchmarking for Lumina

* Add custom game-supported RSV provider

* Refactor and move Lazy<T> and nullable/cached row objects to RowRefs

* Convert IRSVProvider to delegate, resolve strings by default

* Split IExcelRow into IExcelSubrow

* Extra lumina documentation

* Minor RSV CS fixes

* Fix UIGlowPayload warning

* Fix rebase

* Update to Lumina 5
2024-10-20 19:59:03 -07:00

22 lines
747 B
C#

using Lumina.Excel;
namespace Dalamud.Data;
/// <summary>
/// A helper class to easily resolve Lumina data within Dalamud.
/// </summary>
internal static class LuminaUtils
{
private static ExcelModule Module => Service<DataManager>.Get().Excel;
/// <summary>
/// Initializes a new instance of the <see cref="RowRef{T}"/> class using the default <see cref="ExcelModule"/>.
/// </summary>
/// <typeparam name="T">The type of Lumina sheet to resolve.</typeparam>
/// <param name="rowId">The id of the row to resolve.</param>
/// <returns>A new <see cref="RowRef{T}"/> object.</returns>
public static RowRef<T> CreateRef<T>(uint rowId) where T : struct, IExcelRow<T>
{
return new(Module, rowId);
}
}