private void GetZombiePackInfo() { if (_currentZombiePackId == Guid.Empty) return; AsyncDelegation ad = new AsyncDelegation(); ad.Get<ZombiePackProgress>(new { controller = "ZombiePacks", action = "DestructionProgress", userId = _gameContext.UserId, zombiePackId = _currentZombiePackId }) .WhenFinished(r => { _currentZombiePackInfo = r; _view.PopulateDestructionProgress(r.ZombiesLeft, r.MaxZombies, r.CostPerHunt); }); ad.Go(); }
public ActionResult DestructionProgress(Guid userId, Guid zombiePackId) { IUserZombiePackProgress progress = _zombiePackDifficultyDirector.GetCalculatedZombiePackProgress(userId, zombiePackId); ZombiePackProgress progressResult = new ZombiePackProgress { ZombiesLeft = progress.ZombiesLeft, MaxZombies = progress.MaxZombies }; progressResult.CostPerHunt = _zombiePackDifficultyDirector.GetEnergyCost(userId, zombiePackId); return Json(progressResult, JsonRequestBehavior.AllowGet); }