public IActionResult Dojodachi() { HttpContext.Session.Clear(); HttpContext.Session.SetObjectAsJson("TheDojodachi", dojodachi); Models.Dojodachi Retrieve = HttpContext.Session.GetObjectFromJson <Models.Dojodachi>("TheDojodachi"); return(View("Dojodachi", Retrieve)); }
public IActionResult Sleep() { Models.Dojodachi Retrieve = HttpContext.Session.GetObjectFromJson <Models.Dojodachi>("TheDojodachi"); ViewBag.Message = Retrieve.Sleep(); HttpContext.Session.SetObjectAsJson("TheDojodachi", Retrieve); if (Retrieve.Energy > 100 && Retrieve.Fullness > 100 && Retrieve.Happiness > 100) { return(View("Win", Retrieve)); } else if (Retrieve.Fullness < 1 || Retrieve.Happiness < 1) { return(View("Loss", Retrieve)); } else { return(View("Dojodachi", Retrieve)); } }