45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using AibisDream.Framework;
|
|
|
|
namespace AibisDream.FixSystem
|
|
{
|
|
/// <summary>
|
|
/// Runtime registry for systems available to the Fix scene director and cues.
|
|
/// The old SystemDic field remains as a compatibility bridge while call sites migrate.
|
|
/// </summary>
|
|
public class FixSceneContext
|
|
{
|
|
public IOCContainer Registry { get; }
|
|
|
|
public FixSceneContext(IOCContainer registry)
|
|
{
|
|
Registry = registry;
|
|
}
|
|
|
|
public void Register<T>(T instance)
|
|
{
|
|
Registry.Register(instance);
|
|
}
|
|
|
|
public T Get<T>() where T : class
|
|
{
|
|
return Registry.Get<T>();
|
|
}
|
|
|
|
public bool TryGet<T>(out T instance) where T : class
|
|
{
|
|
instance = Registry.Get<T>();
|
|
return instance != null;
|
|
}
|
|
|
|
public T Unregister<T>() where T : class
|
|
{
|
|
return Registry.Unregister<T>();
|
|
}
|
|
|
|
public void Clear()
|
|
{
|
|
Registry.Clear();
|
|
}
|
|
}
|
|
}
|