Пример #1
0
        public GameViewModel GetStartUpVals(GameViewModel model)
        {
            DataLayer.Game.Opponents Opponents = new DataLayer.Game.Opponents();
            List<tblPlayerType> tblPlayerTypes = Opponents.GetOpponents();

            DataLayer.Game.Match Match = new Match();
            List<tblLookupMoveType> MovesTypes = Match.GetStandardMoveSet();

            foreach (var opponent in tblPlayerTypes)
            {
                SelectListItem l = new SelectListItem();
                l.Text = opponent.PlayerType;
                l.Value = opponent.PlayerType;
                //l.Value = opponent.PlayerTypeId.ToString();
                model.OpponentsList.Add(l);
            }

            foreach (var move in MovesTypes)
            {
                SelectListItem l = new SelectListItem();
                l.Text = move.MoveTypeName;
                l.Value = move.MoveTypeName;
                //l.Value = move.MoveTypeId.ToString();
                model.MoveSetList.Add(l);
            }

            model.CurrentRound = 1;
            return model;
        }
Пример #2
0
 public ActionResult Index()
 {
     GameViewModel model = new GameViewModel();
     Business.Game.InitiateGame init = new Business.Game.InitiateGame();
     model = init.GetStartUpVals(model);
     model.NumberOfRoundsList = init.GetNumOfRounds();
     return View(model);
 }
Пример #3
0
 public ActionResult Match(GameViewModel model)
 {
     Business.Game.InitiateGame init = new Business.Game.InitiateGame();
     model = init.GetStartUpVals(model);
     return View(model);
 }
Пример #4
0
 public ActionResult Index(GameViewModel model)
 {
     Business.Game.InitiateGame init = new Business.Game.InitiateGame();
     model.MatchInProgress = init.StartMatch();
     return RedirectToAction("Match", model);
 }