mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-09 02:16:46 +00:00
Add extractable protections to caches
This commit is contained in:
@@ -27,6 +27,20 @@ namespace BurnOutSharp
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cache for all IExtractable types
|
||||
/// </summary>
|
||||
public static IEnumerable<IExtractable> ExtractableClasses
|
||||
{
|
||||
get
|
||||
{
|
||||
if (extractableClasses == null)
|
||||
extractableClasses = InitCheckClasses<IExtractable>();
|
||||
|
||||
return extractableClasses;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cache for all ILinearExecutableCheck types
|
||||
/// </summary>
|
||||
@@ -92,6 +106,11 @@ namespace BurnOutSharp
|
||||
/// </summary>
|
||||
private static IEnumerable<IContentCheck> contentCheckClasses;
|
||||
|
||||
/// <summary>
|
||||
/// Cache for all IExtractable types
|
||||
/// </summary>
|
||||
private static IEnumerable<IExtractable> extractableClasses;
|
||||
|
||||
/// <summary>
|
||||
/// Cache for all ILinearExecutableCheck types
|
||||
/// </summary>
|
||||
@@ -120,8 +139,7 @@ namespace BurnOutSharp
|
||||
/// Initialize all implementations of a type
|
||||
/// </summary>
|
||||
private static IEnumerable<T> InitCheckClasses<T>()
|
||||
=> InitCheckClasses<T>(Assembly.GetExecutingAssembly())
|
||||
.Concat(InitCheckClasses<T>(typeof(BinaryObjectScanner.Packer._DUMMY).Assembly))
|
||||
=> InitCheckClasses<T>(typeof(BinaryObjectScanner.Packer._DUMMY).Assembly)
|
||||
.Concat(InitCheckClasses<T>(typeof(BinaryObjectScanner.Protection._DUMMY).Assembly));
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user