Exemple #1
0
        public ActionResult StartGame(PlayIndexViewModel model)
        {
            List <Player> players = new List <Player>();

            foreach (var playerName in model.Players)
            {
                players.Add(new Player(playerName));
            }

            PlayGameViewModel gameModel = new PlayGameViewModel(players);

            return(View("Game", gameModel));
        }
Exemple #2
0
 public ActionResult DeletePlayer(PlayIndexViewModel model, string player)
 {
     model.Players.Remove(player);
     return(Index(model));
 }
Exemple #3
0
 public ActionResult Index(PlayIndexViewModel model)
 {
     return(View("Index", model));
 }
Exemple #4
0
 public ActionResult AddPlayer(PlayIndexViewModel model)
 {
     model.Players.Add(model.PlayerToAdd);
     return(Index(model));
 }
Exemple #5
0
        public ActionResult Index()
        {
            PlayIndexViewModel model = new PlayIndexViewModel();

            return(Index(model));
        }