Esempio n. 1
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);
 }
Esempio n. 2
0
        // This always processes first turn
        public ActionResult BeginMatch(string humanChoice, string opponentType, string numOfRounds, int currentRound)
        {
            Business.Game.InitiateGame init = new Business.Game.InitiateGame();
            Dictionary<Guid, bool> Outcome = init.InitMatch(numOfRounds);

            if (Outcome.FirstOrDefault().Value)
            { // Were done here - redirect to process turn to take a turn
                return RedirectToAction("ProcessTurn", new
                {
                    humanChoice = humanChoice,
                    opponentType = opponentType,
                    matchId = Outcome.FirstOrDefault().Key,
                    currentRound = currentRound
                });
            }
            else
            {
                // Tell user something went wrong
                return View();
            }
        }
Esempio n. 3
0
 public ActionResult Match(GameViewModel model)
 {
     Business.Game.InitiateGame init = new Business.Game.InitiateGame();
     model = init.GetStartUpVals(model);
     return View(model);
 }
Esempio n. 4
0
 public ActionResult Index(GameViewModel model)
 {
     Business.Game.InitiateGame init = new Business.Game.InitiateGame();
     model.MatchInProgress = init.StartMatch();
     return RedirectToAction("Match", model);
 }