public IncreaseScrapWhenEnemyDestroyed(EnemiesAggregate enemies, ScrapWalletAggregate scrapWallet, int scrapAmount)
 {
     enemies.Events
     .OfType <EnemiesEvent, EnemiesEvent.EnemyDestroyed>()
     .Subscribe(_ => scrapWallet.Increase(scrapAmount));
 }
Beispiel #2
0
 public DecreaseScrapWhenWallRepaired(WallsAggregate walls, ScrapWalletAggregate scrapWallet, RepairCosts repairCosts)
 {
     walls.Events
     .OfType <WallsEvent, WallsEvent.WallRepaired>()
     .Subscribe(_ => scrapWallet.Decrease(repairCosts.Wall));
 }
 public UpdateTowersAndWallsAvailableScrap(TowersAggregate towers, WallsAggregate walls, ScrapWalletAggregate scrapWallet)
 {
     scrapWallet.Events
     .OfType <ScrapWalletEvent, ScrapWalletEvent.AvailableScrapChanged>()
     .Subscribe(changed =>
     {
         towers.UpdateAvailableScrap(changed.CurrentAmount);
         walls.UpdateAvailableScrap(changed.CurrentAmount);
     });
 }
Beispiel #4
0
 public DecreaseScrapWhenTowerRepaired(TowersAggregate towers, ScrapWalletAggregate scrapWallet, RepairCosts repairCosts)
 {
     towers.Events
     .OfType <TowersEvent, TowersEvent.TowerRepaired>()
     .Subscribe(_ => scrapWallet.Decrease(repairCosts.Tower));
 }