public PlayViewResponse PlayView(PlayViewRequest request) { if(!request.PlayerId.HasValue) return new PlayViewResponse { CanPlayGame = false, RequestPlayerInfo = true }; var player = _playerRepository.Get(request.PlayerId.Value); return new PlayViewResponse { PlayerId = player.Id, PlayerName = player.Name, Score = player.CalculateScore(), CanPlayGame = true, RequestPlayerInfo = false }; }
public ActionResult View(PlayViewRequest request) { var response = _colorService.PlayView(request); var model = _colorModelFactory.CreatePlayViewModel(response); return View("Index", model); }