BattleShip.Web.Controllers.GameController.Shoot C# (CSharp) Method

Shoot() private method

private Shoot ( double latitude, double longitude ) : System.Web.Mvc.JsonResult
latitude double
longitude double
return System.Web.Mvc.JsonResult
        public JsonResult Shoot(double latitude, double longitude)
        {
            Guid? gameId = this.Session[MagicStrings.SessionGameId] as Guid?;
            string email = this.Session[MagicStrings.SessionPlayerEmail].ToString();

            var shot = MvcApplication.GameHost.TakeShot(gameId.Value, email, new GeoCoordinate(latitude, longitude));

            var model = new ShootVModel()
                            {
                                InTheTarget = (shot == ShotResult.Hit)
                            };
            return this.Json(shot.ToString(), JsonRequestBehavior.AllowGet);
        }