.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using GodotHostTest.Helpers;
|
||||
using GodotHostTest.Interfaces;
|
||||
using R3;
|
||||
|
||||
namespace GodotHostTest.Game.Target;
|
||||
|
||||
public class TargetEventBus : ITargetEventBus
|
||||
{
|
||||
private readonly Pipe<Unit> _hitOutPipe = new();
|
||||
private readonly Pipe<Unit> _timedOutPipe = new();
|
||||
|
||||
public Observable<Unit> TimedOut => _timedOutPipe.Observable;
|
||||
public Observable<Unit> Hit => _hitOutPipe.Observable;
|
||||
|
||||
public void NewTargetSpawner(ITargetSpawner targetSpawner)
|
||||
{
|
||||
_timedOutPipe.PipeIn(targetSpawner.TargetSpawned.SelectMany(target => target.TimedOut));
|
||||
_hitOutPipe.PipeIn(targetSpawner.TargetSpawned.SelectMany(target => target.Hit));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user