Skip to content

Commit

Permalink
Merge pull request #3 from Soreepeong/wrl2
Browse files Browse the repository at this point in the history
Reformat code
  • Loading branch information
WorkingRobot authored Aug 17, 2024
2 parents 287bc57 + 349d770 commit 24c7964
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Lumina/Excel/BaseExcelSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static BaseExcelSheet From< T >( ExcelModule module, Language language )
/// <inheritdoc cref="From{T}(ExcelModule, Language)"/>
public static BaseSubrowExcelSheet FromSubrow< T >( ExcelModule module, Language language ) where T : struct, IExcelSubrow< T >
{
var attribute = typeof( T ).GetCustomAttribute<SheetAttribute>() ??
var attribute = typeof( T ).GetCustomAttribute< SheetAttribute >() ??
throw new InvalidOperationException( $"{nameof( T )} has no {nameof( SheetAttribute )}. Use the overload of {nameof( From )} with 4 parameters." );

return FromSubrow< T >( module, language, attribute.Name, attribute.ColumnHash );
Expand Down Expand Up @@ -254,7 +254,7 @@ public static BaseSubrowExcelSheet FromSubrow< T >( ExcelModule module, Language

private static ExcelHeaderFile VerifySheet( ExcelModule module, Language language, string sheetName, uint? columnHash = null )
{
var headerFile = module.GameData.GetFile<ExcelHeaderFile>( $"exd/{sheetName}.exh" ) ??
var headerFile = module.GameData.GetFile< ExcelHeaderFile >( $"exd/{sheetName}.exh" ) ??
throw new ArgumentException( "Invalid sheet name", nameof( sheetName ) );

if( module.VerifySheetChecksums && columnHash is { } hash && headerFile.GetColumnsHash() != hash )
Expand Down
4 changes: 2 additions & 2 deletions src/Lumina/Excel/ExcelModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public BaseExcelSheet GetBaseSheet< T >( Language? language = null ) where T : s
/// <inheritdoc cref="GetBaseSheet{T}(Language?)"/>
[EditorBrowsable( EditorBrowsableState.Advanced )]
public BaseSubrowExcelSheet GetBaseSubrowSheet< T >( Language? language = null ) where T : struct, IExcelSubrow< T > =>
(BaseSubrowExcelSheet)GetBaseSheet( typeof( T ), language );
(BaseSubrowExcelSheet) GetBaseSheet( typeof( T ), language );

/// <summary>Loads an <see cref="BaseExcelSheet"/>.</summary>
/// <param name="rowType">Type of the rows in the sheet.</param>
Expand Down Expand Up @@ -145,7 +145,7 @@ public BaseExcelSheet GetBaseSheet( Type rowType, Language? language = null )
{
// Exception thrown here will propagate outside ConcurrentDictionary<>.GetOrAdd without touching the data stored inside dictionary.
throw new ArgumentException(
$"{key.Type.Name} must implement either {typeof( IExcelRow<> ).Name.Split( '`', 2 )[ 0 ]}<{key.Type.Name}> or {typeof( IExcelSubrow<> ).Name.Split( '`', 2 )[0]}<{key.Type.Name}>.",
$"{key.Type.Name} must implement either {typeof( IExcelRow<> ).Name.Split( '`', 2 )[ 0 ]}<{key.Type.Name}> or {typeof( IExcelSubrow<> ).Name.Split( '`', 2 )[ 0 ]}<{key.Type.Name}>.",
nameof( rowType ),
e );
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lumina/Excel/IExcelRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public interface IExcelRow< out T > where T : struct
/// <param name="row"></param>
/// <returns>A newly created row object.</returns>
abstract static T Create( ExcelPage page, uint offset, uint row );
}
}
2 changes: 1 addition & 1 deletion src/Lumina/Excel/RowRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public readonly struct RowRef< T >( ExcelModule? module, uint rowId ) where T :
/// </summary>
/// <param name="row">The <see cref="RowRef{T}"/> to convert.</param>
public static explicit operator RowRef( RowRef< T > row ) => row.ToGeneric();
}
}
2 changes: 1 addition & 1 deletion src/Lumina/Excel/SubrowRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Lumina.Excel;
/// <param name="rowId">The referenced row id.</param>
public readonly struct SubrowRef< T >( ExcelModule? module, uint rowId ) where T : struct, IExcelSubrow< T >
{
private readonly SubrowExcelSheet< T >? _sheet = module?.GetSubrowSheet<T>();
private readonly SubrowExcelSheet< T >? _sheet = module?.GetSubrowSheet< T >();

/// <summary>
/// The row id of the referenced row.
Expand Down
4 changes: 2 additions & 2 deletions src/Lumina/Excel/UntypedRowRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public bool TryGetValue< T >( out T row ) where T : struct, IExcelRow< T >
}

/// <inheritdoc cref="TryGetValue{T}(out T)"/>
public bool TryGetValueSubrow< T >( out SubrowCollection< T > row ) where T : struct, IExcelSubrow<T>
public bool TryGetValueSubrow< T >( out SubrowCollection< T > row ) where T : struct, IExcelSubrow< T >
{
if( new SubrowRef< T >( module, rowId ).ValueNullable is { } v )
{
Expand Down Expand Up @@ -127,4 +127,4 @@ public static RowRef GetFirstValidRowOrUntyped( ExcelModule module, uint rowId,
/// <param name="rowId">The referenced row id.</param>
/// <returns>An untyped <see cref="RowRef"/>.</returns>
public static RowRef CreateUntyped( uint rowId ) => new( null, rowId, null );
}
}

0 comments on commit 24c7964

Please sign in to comment.