public IActionResult Sleep() { Dachi CurrDachiData = HttpContext.Session.GetObjectFromJson <Dachi>("DachiData"); CurrDachiData.sleep(); HttpContext.Session.SetObjectAsJson("DachiData", CurrDachiData); return(RedirectToAction("Index")); }
public JsonResult Sleep() { Dachi dachi = HttpContext.Session.GetObjectFromJson <Dachi>("Dachi"); dachi.sleep(); HttpContext.Session.SetObjectAsJson("Dachi", dachi); return(Json(dachi)); }
public IActionResult Sleep() { Dachi DachiInfo = HttpContext.Session.GetObjectFromJson <Dachi>("DachiInfo"); DachiInfo.sleep(); HttpContext.Session.SetObjectAsJson("DachiInfo", DachiInfo); return(RedirectToAction("Index")); }
public IActionResult Sleep() { List <Dachi> ret = HttpContext.Session.GetObjectFromJson <List <Dachi> >("dachi"); Dachi dachi = (Dachi)ret[0]; TempData["response"] = dachi.sleep(); List <object> dachilist = new List <object>(); dachilist.Add(dachi); HttpContext.Session.SetObjectAsJson("dachi", dachilist); return(RedirectToAction("Index")); }
public IActionResult dachi(string button) { Dachi meep = HttpContext.Session.GetObjectFromJson <Dachi>("dachi"); if (button == "Feed") { meep.feed(meep); List <string> check = meep.status(meep); if (check.Contains("fine")) { HttpContext.Session.SetObjectAsJson("dachi", meep); return(RedirectToAction("page")); } else if (check.Contains("win")) { return(View("win")); } else if (check.Contains("dead")) { return(View("dead")); } } else if (button == "Play") { meep.play(meep); List <string> check = meep.status(meep); if (check.Contains("fine")) { HttpContext.Session.SetObjectAsJson("dachi", meep); return(RedirectToAction("page")); } else if (check.Contains("win")) { return(View("win")); } else if (check.Contains("dead")) { return(View("dead")); } } else if (button == "Work") { meep.work(meep); List <string> check = meep.status(meep); if (check.Contains("fine")) { HttpContext.Session.SetObjectAsJson("dachi", meep); return(RedirectToAction("page")); } else if (check.Contains("win")) { return(View("win")); } else if (check.Contains("dead")) { return(View("dead")); } } else if (button == "Sleep") { meep.sleep(meep); List <string> check = meep.status(meep); if (check.Contains("fine")) { HttpContext.Session.SetObjectAsJson("dachi", meep); return(RedirectToAction("page")); } else if (check.Contains("win")) { return(View("win")); } else if (check.Contains("dead")) { return(View("dead")); } } return(View("index")); }