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); }
// 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(); } }
public ActionResult Match(GameViewModel model) { Business.Game.InitiateGame init = new Business.Game.InitiateGame(); model = init.GetStartUpVals(model); return View(model); }
public ActionResult Index(GameViewModel model) { Business.Game.InitiateGame init = new Business.Game.InitiateGame(); model.MatchInProgress = init.StartMatch(); return RedirectToAction("Match", model); }