示例#1
0
        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);
        }
示例#2
0
        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));
        }        
示例#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);
        }