using GodotHostTest.Helpers; using GodotHostTest.Interfaces; using R3; namespace GodotHostTest.Game.Target; public class TargetEventBus : ITargetEventBus { private readonly Pipe _hitOutPipe = new(); private readonly Pipe _timedOutPipe = new(); public Observable TimedOut => _timedOutPipe.Observable; public Observable Hit => _hitOutPipe.Observable; public void NewTargetSpawner(ITargetSpawner targetSpawner) { _timedOutPipe.PipeIn(targetSpawner.TargetSpawned.SelectMany(target => target.TimedOut)); _hitOutPipe.PipeIn(targetSpawner.TargetSpawned.SelectMany(target => target.Hit)); } }