Skip to content

Commit

Permalink
Extra lumina documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Aug 19, 2024
1 parent 5fdbb65 commit 49e4ed4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Dalamud/Data/DataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ private DataManager(Dalamud dalamud)
#region Lumina Wrappers

/// <inheritdoc/>
public ExcelSheet<T> GetExcelSheet<T>(ClientLanguage? language = null) where T : struct, IExcelRow<T>
=> this.Excel.GetSheet<T>(language?.ToLumina());
public ExcelSheet<T> GetExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelRow<T>
=> this.Excel.GetSheet<T>(language?.ToLumina(), name);

/// <inheritdoc/>
public SubrowExcelSheet<T> GetSubrowExcelSheet<T>(ClientLanguage? language = null) where T : struct, IExcelSubrow<T>
=> this.Excel.GetSubrowSheet<T>(language?.ToLumina());
public SubrowExcelSheet<T> GetSubrowExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelSubrow<T>
=> this.Excel.GetSubrowSheet<T>(language?.ToLumina(), name);

/// <inheritdoc/>
public FileResource? GetFile(string path)
Expand Down
24 changes: 20 additions & 4 deletions Dalamud/Plugin/Services/IDataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

using Lumina;
using Lumina.Data;
using Lumina.Data.Structs.Excel;
using Lumina.Excel;
using Lumina.Excel.Exceptions;

namespace Dalamud.Plugin.Services;

Expand Down Expand Up @@ -38,23 +40,37 @@ public interface IDataManager
/// Get an <see cref="ExcelSheet{T}"/> with the given Excel sheet row type.
/// </summary>
/// <param name="language">Language of the sheet to get. Leave <see langword="null"/> or empty to use the default language.</param>
/// <param name="name">Explicitly provide the name of the sheet to get. Leave <see langword="null"/> to use <typeparamref name="T"/>'s sheet name. Explicit names are necessary for quest/dungeon/cutscene sheets.</param>
/// <typeparam name="T">The excel sheet type to get.</typeparam>
/// <returns>The <see cref="ExcelSheet{T}"/>, giving access to game rows.</returns>
/// <remarks>
/// If the sheet type you want has subrows, use <see cref="GetSubrowExcelSheet{T}(ClientLanguage?)"/> instead.
/// If the sheet type you want has subrows, use <see cref="GetSubrowExcelSheet{T}(ClientLanguage?, string?)"/> instead.
/// </remarks>
public ExcelSheet<T> GetExcelSheet<T>(ClientLanguage? language = null) where T : struct, IExcelRow<T>;
/// <exception cref="SheetNameEmptyException">Sheet name was not specified neither via <typeparamref name="T"/>'s <see cref="SheetAttribute.Name"/> nor <paramref name="name"/>.</exception>
/// <exception cref="SheetAttributeMissingException"><typeparamref name="T"/> does not have a valid <see cref="SheetAttribute"/>.</exception>
/// <exception cref="SheetNotFoundException">Sheet does not exist.</exception>
/// <exception cref="MismatchedColumnHashException">Sheet had a mismatched column hash.</exception>
/// <exception cref="UnsupportedLanguageException">Sheet does not support <paramref name="language" /> nor <see cref="Language.None"/>.</exception>
/// <exception cref="NotSupportedException">Sheet was not a <see cref="ExcelVariant.Default"/>.</exception>
public ExcelSheet<T> GetExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelRow<T>;

/// <summary>
/// Get a <see cref="SubrowExcelSheet{T}"/> with the given Excel sheet row type.
/// </summary>
/// <param name="language">Language of the sheet to get. Leave <see langword="null"/> or empty to use the default language.</param>
/// <param name="name">Explicitly provide the name of the sheet to get. Leave <see langword="null"/> to use <typeparamref name="T"/>'s sheet name. Explicit names are necessary for quest/dungeon/cutscene sheets.</param>
/// <typeparam name="T">The excel sheet type to get.</typeparam>
/// <returns>The <see cref="SubrowExcelSheet{T}"/>, giving access to game rows.</returns>
/// <remarks>
/// If the sheet type you want has only rows, use <see cref="GetExcelSheet{T}(ClientLanguage?)"/> instead.
/// If the sheet type you want has only rows, use <see cref="GetExcelSheet{T}(ClientLanguage?, string?)"/> instead.
/// </remarks>
public SubrowExcelSheet<T> GetSubrowExcelSheet<T>(ClientLanguage? language = null) where T : struct, IExcelSubrow<T>;
/// <exception cref="SheetNameEmptyException">Sheet name was not specified neither via <typeparamref name="T"/>'s <see cref="SheetAttribute.Name"/> nor <paramref name="name"/>.</exception>
/// <exception cref="SheetAttributeMissingException"><typeparamref name="T"/> does not have a valid <see cref="SheetAttribute"/>.</exception>
/// <exception cref="SheetNotFoundException">Sheet does not exist.</exception>
/// <exception cref="MismatchedColumnHashException">Sheet had a mismatched column hash.</exception>
/// <exception cref="UnsupportedLanguageException">Sheet does not support <paramref name="language" /> nor <see cref="Language.None"/>.</exception>
/// <exception cref="NotSupportedException">Sheet was not a <see cref="ExcelVariant.Subrows"/>.</exception>
public SubrowExcelSheet<T> GetSubrowExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelSubrow<T>;

/// <summary>
/// Get a <see cref="FileResource"/> with the given path.
Expand Down

0 comments on commit 49e4ed4

Please sign in to comment.