public ActionResult NewGame()
        {
            var model = new NewGameViewModel();
            model.CardsToChooseFrom = CardFactory.OptionalCardsForBank.OrderBy(c => c).ToList();
            model.ChosenCards = model.CardsToChooseFrom.Take(10).ToList();

            return View(model);
        }
        public ActionResult NewGame(NewGameViewModel model)
        {
            var namesArray = model.Names
                .Split(new[] {',', '.'}, StringSplitOptions.RemoveEmptyEntries)
                .Select(n => n.Trim());

            string gameKey = _host.CreateNewGame(namesArray, model.NumberOfPlayers, model.ChosenCards, model.UseProsperty);
            return this.RedirectToAction(x => x.ViewPlayers(gameKey));
        }        
Exemple #3
0
        public ActionResult NewGame()
        {
            //this.Response.Cache.SetNoStore();
            this.Response.Cache.SetCacheability(HttpCacheability.NoCache);


            var model = new NewGameViewModel();
            model.CardsToChooseFrom = CardFactory.OptionalCardsForBank.OrderBy(c => c).ToList();

            var random = new Random();
            model.ChosenCards = model.CardsToChooseFrom.OrderBy(x => random.Next(100)).Take(10).ToList();

            return View(model);
        }