BattleShip.Web.Controllers.GameController.IsItMyTurn C# (CSharp) Méthode

IsItMyTurn() public méthode

public IsItMyTurn ( ) : System.Web.Mvc.JsonResult
Résultat System.Web.Mvc.JsonResult
        public JsonResult IsItMyTurn()
        {
            Guid? gameId = this.Session[MagicStrings.SessionGameId] as Guid?;
            string email = this.Session[MagicStrings.SessionPlayerEmail].ToString();

            var nextPlayerEmail = MvcApplication.GameHost.GetNextPlayerEmail(gameId.Value);
            if (nextPlayerEmail == email)
            {
                return this.Json(true, JsonRequestBehavior.AllowGet);
            }

            return this.Json(false, JsonRequestBehavior.AllowGet);
        }