-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pre-release' into release
- Loading branch information
Showing
58 changed files
with
2,341 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
Mutagen.Bethesda.Core.UnitTests/AutoData/MutagenModAutoData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using AutoFixture; | ||
using AutoFixture.Xunit2; | ||
using Mutagen.Bethesda.Testing.AutoData; | ||
|
||
namespace Mutagen.Bethesda.UnitTests.AutoData; | ||
|
||
public class MutagenModAutoDataAttribute : AutoDataAttribute | ||
{ | ||
public MutagenModAutoDataAttribute( | ||
GameRelease Release = GameRelease.SkyrimSE, | ||
bool UseMockFileSystem = true) | ||
: base(() => | ||
{ | ||
var ret = new Fixture(); | ||
ret.Customize(new MutagenDefaultCustomization( | ||
useMockFileSystem: UseMockFileSystem, | ||
configureMembers: false, | ||
release: Release)); | ||
ret.Customize(new MutagenConcreteModsCustomization(release: Release)); | ||
return ret; | ||
}) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using Mutagen.Bethesda.Plugins.Records; | ||
|
||
namespace Mutagen.Bethesda; | ||
|
||
public static class IModExt | ||
{ | ||
|
||
/// <summary> | ||
/// Returns the top-level Group getter object associated with the given Major Record Type. | ||
/// </summary> | ||
/// <returns>Group getter object associated with the given Major Record Type</returns> | ||
/// <typeparam name="TMajor">The type of Major Record to get the Group for</typeparam> | ||
/// <exception cref="ArgumentException"> | ||
/// An unexpected TMajor type will throw an exception.<br /> | ||
/// Unexpected types include: <br /> | ||
/// - Major Record Types that are not part of this game type. (Querying for Oblivion records on a Skyrim mod) <br /> | ||
/// - Nested types, where there is not just one top level group that contains given type (Placed Objects) <br /> | ||
/// - A setter type is requested from a getter only object. <br /> | ||
/// </exception> | ||
public static IGroupGetter<TMajor> GetTopLevelGroup<TMajor>(this IModGetter mod) | ||
where TMajor : IMajorRecordGetter | ||
{ | ||
return mod.TryGetTopLevelGroup<TMajor>() ?? throw new ArgumentException($"Unknown major record type: {typeof(TMajor)}"); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the top-level Group getter object associated with the given Major Record Type. | ||
/// </summary> | ||
/// <returns>Group getter object associated with the given Major Record Type</returns> | ||
/// <param name="type">The type of Major Record to get the Group for</param> | ||
/// <exception cref="ArgumentException"> | ||
/// An unexpected TMajor type will throw an exception.<br /> | ||
/// Unexpected types include: <br /> | ||
/// - Major Record Types that are not part of this game type. (Querying for Oblivion records on a Skyrim mod) <br /> | ||
/// - Nested types, where there is not just one top level group that contains given type (Placed Objects) <br /> | ||
/// - A setter type is requested from a getter only object. <br /> | ||
/// </exception> | ||
public static IGroupGetter GetTopLevelGroup(this IModGetter mod, Type type) | ||
{ | ||
return mod.TryGetTopLevelGroup(type) ?? throw new ArgumentException($"Unknown major record type: {type}"); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the Group object associated with the given Major Record Type. | ||
/// </summary> | ||
/// <returns>Group object associated with the given Major Record Type</returns> | ||
/// <typeparam name="TMajor">The type of Major Record to get the Group for</typeparam> | ||
/// <exception cref="ArgumentException"> | ||
/// An unexpected TMajor type will throw an exception. | ||
/// Unexpected types include: | ||
/// - Major Record Types that are not part of this game type. (Querying for Oblivion records on a Skyrim mod) | ||
/// - A setter type is requested from a getter only object. | ||
/// </exception> | ||
public static IGroup<TMajor> GetTopLevelGroup<TMajor>(this IMod mod) | ||
where TMajor : IMajorRecord | ||
{ | ||
return mod.TryGetTopLevelGroup<TMajor>() ?? throw new ArgumentException($"Unknown major record type: {typeof(TMajor)}"); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the top-level Group getter object associated with the given Major Record Type. | ||
/// </summary> | ||
/// <returns>Group getter object associated with the given Major Record Type</returns> | ||
/// <param name="type">The type of Major Record to get the Group for</param> | ||
/// <exception cref="ArgumentException"> | ||
/// An unexpected TMajor type will throw an exception.<br /> | ||
/// Unexpected types include: <br /> | ||
/// - Major Record Types that are not part of this game type. (Querying for Oblivion records on a Skyrim mod) <br /> | ||
/// - Nested types, where there is not just one top level group that contains given type (Placed Objects) <br /> | ||
/// - A setter type is requested from a getter only object. <br /> | ||
/// </exception> | ||
public static IGroup GetTopLevelGroup(this IMod mod, Type type) | ||
{ | ||
return mod.TryGetTopLevelGroup(type) ?? throw new ArgumentException($"Unknown major record type: {type}"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.