Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Lumina/Excel/RowRef{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ private ExcelSheet< T >? Sheet {
/// </remarks>
public readonly Language? Language => language ?? module?.Language;

/// <summary>
/// Tries to get the referenced row as a specific row type.
/// </summary>
/// <param name="row">The output row object.</param>
/// <returns><see langword="true"/> if the type is valid, the row exists, and <paramref name="row"/> is written to, and <see langword="false"/> otherwise.</returns>
public bool TryGetValue( out T row )
{
var valueNullable = ValueNullable;
row = valueNullable ?? default;
return valueNullable.HasValue;
}

/// <summary>
/// Whether the <see cref="RowId"/> exists in the sheet.
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions src/Lumina/Excel/SubrowRef{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ private SubrowExcelSheet< T >? Sheet {
/// </remarks>
public readonly Language? Language => language ?? module?.Language;

/// <inheritdoc cref="RowRef{T}.TryGetValue(out T)"/>
public bool TryGetValue( out SubrowCollection<T> row )
{
var valueNullable = ValueNullable;
row = valueNullable ?? default;
return valueNullable.HasValue;
}

/// <summary>
/// Whether the <see cref="RowId"/> exists in the sheet.
/// </summary>
Expand Down
Loading