using System; using System.Diagnostics; using Godot; using GodotHostTest.AetherBind; using GodotHostTest.Game.Target; using GodotHostTest.Interfaces; using OwofGames.AetherBind; using OwofGames.GodotLume; using ServiceSource = GodotHostTest.AetherBind.ServiceSource; namespace GodotHostTest.Game.Level; public partial class LevelServiceSource : ServiceSource { [Export] private TargetSpawner _targetSpawner = null!; protected override void OnScopeCreated(IProvider serviceProvider) { OnScopeCreatedWithProvider(serviceProvider); } [WithProvider] private void OnScopeCreated(IValueSetter targetCollector, IValueSetter targetSpawner, ActivitySource activitySource, IValueSetter activity) { // ReSharper disable once ExplicitCallerInfoArgument - the caller name is not significant in this case var activityValue = activitySource.StartActivity("Level") ?? throw new InvalidOperationException( "No listeners for the activity - is OpenTelemetry running?"); activity.Set(activityValue); targetCollector.Set(_targetSpawner); targetSpawner.Set(_targetSpawner); } }