Make IDependencyCollection constructable. (#6466)

This commit is contained in:
Moony
2026-05-05 10:00:12 -07:00
committed by GitHub
parent eb0f03596c
commit f948bafd3a
@@ -221,5 +221,21 @@ namespace Robust.Shared.IoC
/// </exception>
/// <seealso cref="DependencyCollection.BuildGraph"/>
void InjectDependencies(object obj, bool oneOff=false);
/// <summary>
/// Creates a new, empty dependency collection.
/// </summary>
public static IDependencyCollection Create()
{
return new DependencyCollection();
}
/// <summary>
/// Creates a new dependency collection, copying the contents of its parent.
/// </summary>
public static IDependencyCollection CreateFrom(IDependencyCollection parent)
{
return new DependencyCollection(parent);
}
}
}