feat: more plugin work and intra-scope communication

This commit is contained in:
redglow
2026-07-18 10:56:54 +02:00
parent 7c16dddbd0
commit ce58a3a2c2
22 changed files with 246 additions and 56 deletions
+18
View File
@@ -0,0 +1,18 @@
using OwofGames.GodotLume;
namespace GodotHostTest.GodotDI;
public static class BuilderExtensions
{
public static Builder AddValueProvider<TValueType, TSourceScope, TDestinationScope>(this Builder builder)
where TSourceScope : RootScope
where TDestinationScope : TSourceScope
{
var valueProvider = new ValueProvider<TValueType>();
return builder
.AddScoped<IValueSetter<TValueType>, IValueSetter<TValueType>, TSourceScope>(Builder.NoDependencies,
_ => valueProvider.Setter)
.AddScoped<IValueGetter<TValueType>, IValueGetter<TValueType>, TDestinationScope>(Builder.NoDependencies,
_ => valueProvider.Getter);
}
}