mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-23 08:17:47 +01:00
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
This commit is contained in:
parent
08d8605871
commit
0b9af0e3f4
49 changed files with 460 additions and 403 deletions
|
|
@ -1,6 +1,3 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Utility;
|
||||
using Lumina.Excel;
|
||||
|
|
@ -11,31 +8,46 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
|||
/// Test setup for Lumina.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">ExcelRow to run test on.</typeparam>
|
||||
internal class LuminaAgingStep<T> : IAgingStep
|
||||
where T : ExcelRow
|
||||
/// <param name="isLargeSheet">Whether or not the sheet is large. If it is large, the self test will iterate through the full sheet in one frame and benchmark the time taken.</param>
|
||||
internal class LuminaAgingStep<T>(bool isLargeSheet) : IAgingStep
|
||||
where T : struct, IExcelRow<T>
|
||||
{
|
||||
private int step = 0;
|
||||
private List<T> rows;
|
||||
private ExcelSheet<T> rows;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Lumina";
|
||||
public string Name => $"Test Lumina ({typeof(T).Name})";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
var dataManager = Service<DataManager>.Get();
|
||||
this.rows ??= Service<DataManager>.Get().GetExcelSheet<T>();
|
||||
|
||||
this.rows ??= dataManager.GetExcelSheet<T>().ToList();
|
||||
if (isLargeSheet)
|
||||
{
|
||||
var i = 0;
|
||||
T currentRow = default;
|
||||
foreach (var row in this.rows)
|
||||
{
|
||||
i++;
|
||||
currentRow = row;
|
||||
}
|
||||
|
||||
Util.ShowObject(this.rows[this.step]);
|
||||
Util.ShowObject(currentRow);
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
else
|
||||
{
|
||||
Util.ShowObject(this.rows.GetRowAt(this.step));
|
||||
|
||||
this.step++;
|
||||
return this.step >= this.rows.Count ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
this.step++;
|
||||
return this.step >= this.rows.Count ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
this.step = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue