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