Skip to content

Commit f7fd2f6

Browse files
committed
Name some type parameters
1 parent 281c18e commit f7fd2f6

File tree

5 files changed

+27
-26
lines changed

5 files changed

+27
-26
lines changed

SabreTools.Serialization/Models/SGA/DirectoryHeader.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ public abstract class DirectoryHeader
77
}
88

99
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
10-
public abstract class DirectoryHeader<T> where T : notnull
10+
public abstract class DirectoryHeader<TNumeric> where TNumeric : notnull
1111
{
1212
public uint SectionOffset { get; set; }
1313

14-
public T? SectionCount { get; set; }
14+
public TNumeric? SectionCount { get; set; }
1515

1616
public uint FolderOffset { get; set; }
1717

18-
public T? FolderCount { get; set; }
18+
public TNumeric? FolderCount { get; set; }
1919

2020
public uint FileOffset { get; set; }
2121

22-
public T? FileCount { get; set; }
22+
public TNumeric? FileCount { get; set; }
2323

2424
public uint StringTableOffset { get; set; }
2525

26-
public T? StringTableCount { get; set; }
26+
public TNumeric? StringTableCount { get; set; }
2727
}
2828
}

SabreTools.Serialization/Models/SGA/Folder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ public abstract class Folder
99
}
1010

1111
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
12-
public abstract class Folder<T> : Folder where T : notnull
12+
public abstract class Folder<TNumeric> : Folder where TNumeric : notnull
1313
{
14-
public T? FolderStartIndex { get; set; }
14+
public TNumeric? FolderStartIndex { get; set; }
1515

16-
public T? FolderEndIndex { get; set; }
16+
public TNumeric? FolderEndIndex { get; set; }
1717

18-
public T? FileStartIndex { get; set; }
18+
public TNumeric? FileStartIndex { get; set; }
1919

20-
public T? FileEndIndex { get; set; }
20+
public TNumeric? FileEndIndex { get; set; }
2121
}
2222
}

SabreTools.Serialization/Models/SGA/Section.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ public abstract class Section
99
}
1010

1111
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
12-
public abstract class Section<T> : Section where T : notnull
12+
public abstract class Section<TNumeric> : Section where TNumeric : notnull
1313
{
14-
public T? FolderStartIndex { get; set; }
14+
public TNumeric? FolderStartIndex { get; set; }
1515

16-
public T? FolderEndIndex { get; set; }
16+
public TNumeric? FolderEndIndex { get; set; }
1717

18-
public T? FileStartIndex { get; set; }
18+
public TNumeric? FileStartIndex { get; set; }
1919

20-
public T? FileEndIndex { get; set; }
20+
public TNumeric? FileEndIndex { get; set; }
2121

22-
public T? FolderRootIndex { get; set; }
22+
public TNumeric? FolderRootIndex { get; set; }
2323
}
2424
}

SabreTools.Serialization/Wrappers/ObjectExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace SabreTools.Serialization.Wrappers
1010
/// <see href="https://stackoverflow.com/a/72775719"/>
1111
internal static class ObjectExtensions
1212
{
13-
public static T ThrowOnNull<T>(this T? value) where T : class => value ?? throw new ArgumentNullException();
13+
public static TClass ThrowOnNull<TClass>(this TClass? value) where TClass : class
14+
=> value ?? throw new ArgumentNullException();
1415
}
1516
}
1617

SabreTools.Serialization/Wrappers/WrapperBaseT.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
namespace SabreTools.Serialization.Wrappers
44
{
5-
public abstract class WrapperBase<T> : WrapperBase, IWrapper<T>
5+
public abstract class WrapperBase<TModel> : WrapperBase, IWrapper<TModel>
66
{
77
#region Properties
88

99
/// <inheritdoc/>
10-
public T GetModel() => Model;
10+
public TModel GetModel() => Model;
1111

1212
/// <summary>
1313
/// Internal model
1414
/// </summary>
15-
public T Model { get; }
15+
public TModel Model { get; }
1616

1717
#endregion
1818

@@ -23,7 +23,7 @@ public abstract class WrapperBase<T> : WrapperBase, IWrapper<T>
2323
/// </summary>
2424
/// <param name="model">Model to be used in the wrapper</param>
2525
/// <param name="data">Underlying data for the wrapper</param>
26-
protected WrapperBase(T model, byte[] data)
26+
protected WrapperBase(TModel model, byte[] data)
2727
: this(model, data, 0, data.Length)
2828
{
2929
}
@@ -34,7 +34,7 @@ protected WrapperBase(T model, byte[] data)
3434
/// <param name="model">Model to be used in the wrapper</param>
3535
/// <param name="data">Underlying data for the wrapper</param>
3636
/// <param name="offset">Offset into the data to use as the window start</param>
37-
protected WrapperBase(T model, byte[] data, int offset)
37+
protected WrapperBase(TModel model, byte[] data, int offset)
3838
: this(model, data, offset, data.Length - offset)
3939
{
4040
}
@@ -46,7 +46,7 @@ protected WrapperBase(T model, byte[] data, int offset)
4646
/// <param name="data">Underlying data for the wrapper</param>
4747
/// <param name="offset">Offset into the data to use as the window start</param>
4848
/// <param name="length">Length of the window into the data</param>
49-
protected WrapperBase(T model, byte[] data, int offset, int length)
49+
protected WrapperBase(TModel model, byte[] data, int offset, int length)
5050
: base(data, offset, length)
5151
{
5252
Model = model;
@@ -62,7 +62,7 @@ protected WrapperBase(T model, byte[] data, int offset, int length)
6262
/// <param name="model">Model to be used in the wrapper</param>
6363
/// <param name="data">Underlying data for the wrapper</param>
6464
/// <remarks>Uses the current stream position as the offset</remarks>
65-
protected WrapperBase(T model, Stream data)
65+
protected WrapperBase(TModel model, Stream data)
6666
: this(model, data, data.Position, data.Length - data.Position)
6767
{
6868
}
@@ -73,7 +73,7 @@ protected WrapperBase(T model, Stream data)
7373
/// <param name="model">Model to be used in the wrapper</param>
7474
/// <param name="data">Underlying data for the wrapper</param>
7575
/// <param name="offset">Offset into the data to use as the window start</param>
76-
protected WrapperBase(T model, Stream data, long offset)
76+
protected WrapperBase(TModel model, Stream data, long offset)
7777
: this(model, data, offset, data.Length - offset)
7878
{
7979
}
@@ -85,7 +85,7 @@ protected WrapperBase(T model, Stream data, long offset)
8585
/// <param name="data">Underlying data for the wrapper</param>
8686
/// <param name="offset">Offset into the data to use as the window start</param>
8787
/// <param name="length">Length of the window into the data</param>
88-
protected WrapperBase(T model, Stream data, long offset, long length)
88+
protected WrapperBase(TModel model, Stream data, long offset, long length)
8989
: base(data, offset, length)
9090
{
9191
Model = model;

0 commit comments

Comments
 (0)