Exemple #1
0
 public NotifyPathAggregateWhenEnemiesAreSpawned(EnemiesAggregate enemy, PathFinderAggregate pathFinder)
 {
     enemy.Events
     .OfType <EnemiesEvent, EnemiesEvent.EnemySpawned>()
     .DelayFrame(1)
     .Subscribe(spawned => HandleEnemiesSpawnedEvent(spawned, pathFinder));
 }
Exemple #2
0
 public NotifyPathAggregateWhenCellsAreOccupied(MapAggregate map, TowersAggregate tower, WallsAggregate wall,
                                                [NotNull] PathFinderAggregate pathFinder)
 {
     _pathFinder = pathFinder ?? throw new ArgumentNullException(nameof(pathFinder));
     map.Events.OfType <MapEvent, MapEvent.Initialized>().Subscribe(HandleMapInitialized);
     tower.Events.OfType <TowersEvent, TowersEvent.TowerRepaired>().Subscribe(HandleTowerRepaired);
     wall.Events.OfType <WallsEvent, WallsEvent.WallRepaired>().Subscribe(HandleWallRepaired);
 }
Exemple #3
0
 private void HandleEnemiesSpawnedEvent(EnemiesEvent.EnemySpawned e, PathFinderAggregate pathFinder)
 {
     pathFinder.AddEnemy(e.EnemyId);
 }