ds5678 45cf0a33d6 Create prefabs and scenes during processing
* Add PrefabHierarchyObject and SceneHierarchyObject
* Scene ordering remains the same, but prefabs get sorted by asset type
* This might solve an issue with pptr's inside a prefab. Previously, AssetsExportCollection.File was not changing while enumerating ExportableAssets.
* SceneExportCollection uses random export id's for artificially generated assets. Previously, there were no generated assets in scenes.
2024-02-19 02:24:22 -05:00

34 lines
729 B
C#

namespace AssetRipper.SourceGenerated.Extensions
{
public static class EnumerableExtensions
{
public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> enumerable) where T : notnull
{
foreach (T? item in enumerable)
{
if (item is not null)
{
yield return item;
}
}
}
public static IEnumerable<T> ThrowIfNull<T>(this IEnumerable<T?> enumerable) where T : notnull
{
foreach (T? item in enumerable)
{
if (item is null)
{
throw new NullReferenceException();
}
yield return item;
}
}
public static IEnumerable<T> MaybeAppend<T>(this IEnumerable<T> enumerable, T? item)
{
return item is not null ? enumerable.Append(item) : enumerable;
}
}
}