feat(ExcelResolver): add GetWithLanguage

This commit is contained in:
goaaats 2022-01-17 04:50:38 +01:00
parent 9558855578
commit 7a0f514bc9
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -26,6 +26,13 @@ namespace Dalamud.Game.ClientState.Resolvers
/// <summary>
/// Gets GameData linked to this excel row.
/// </summary>
public T GameData => Service<DataManager>.Get().GetExcelSheet<T>().GetRow(this.Id);
public T? GameData => Service<DataManager>.Get().GetExcelSheet<T>()?.GetRow(this.Id);
/// <summary>
/// Gets GameData linked to this excel row with the specified language.
/// </summary>
/// <param name="language">The language.</param>
/// <returns>The ExcelRow in the specified language.</returns>
public T? GetWithLanguage(ClientLanguage language) => Service<DataManager>.Get().GetExcelSheet<T>(language)?.GetRow(this.Id);
}
}