public IActionResult RockPaperScissorsGame()
        {
            var gameViewModel = new PlayersHomePageViewModel();

            SetUpComputerPlayer(gameViewModel);
            SetOptions(gameViewModel);//
            return(View("/Views/RockPaperScissorsGame/RockPaperScissorsGame.cshtml", gameViewModel));
        }
 private void SetOptions(PlayersHomePageViewModel gameViewModel)
 {
     gameViewModel.Players = new List <SelectListItem>
     {
         new SelectListItem {
             Text = "Computer", Value = JsonConvert.SerializeObject(gameViewModel.PlayerTwo)
         }
     };
 }
        public IActionResult RockPaperScissorsGame(PlayersHomePageViewModel playersHomePageViewModel)
        {
            playersHomePageViewModel.PlayerTwo.ScoreSheet = new PlayerScoreSheetViewModel();
            playersHomePageViewModel.PlayerOne.ScoreSheet = new PlayerScoreSheetViewModel();
            var gameViewModel = new RockPaperScissorsGameViewModel(playersHomePageViewModel.PlayerOne,
                                                                   playersHomePageViewModel.PlayerTwo);

            HttpContext.Session.SetString(sessionKey, JsonConvert.SerializeObject(gameViewModel));
            return(PartialView("/Views/RockPaperScissorsGame/_RockPaperScissorsGamePartial.cshtml", gameViewModel));
        }
 private void SetUpComputerPlayer(PlayersHomePageViewModel gameViewModel)
 {
     gameViewModel.PlayerTwo = new PlayerViewModel {
         UserName = "******", PlayerType = PlayerType.COMPUTER
     };
 }