Esempio n. 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));
        }
Esempio n. 2
0
 public ActionResult DeletePlayer(PlayIndexViewModel model, string player)
 {
     model.Players.Remove(player);
     return(Index(model));
 }
Esempio n. 3
0
 public ActionResult Index(PlayIndexViewModel model)
 {
     return(View("Index", model));
 }
Esempio n. 4
0
 public ActionResult AddPlayer(PlayIndexViewModel model)
 {
     model.Players.Add(model.PlayerToAdd);
     return(Index(model));
 }
Esempio n. 5
0
        public ActionResult Index()
        {
            PlayIndexViewModel model = new PlayIndexViewModel();

            return(Index(model));
        }