Beispiel #1
0
        public IActionResult Sleep()
        {
            Dachi CurrDachiData = HttpContext.Session.GetObjectFromJson <Dachi>("DachiData");

            CurrDachiData.sleep();
            HttpContext.Session.SetObjectAsJson("DachiData", CurrDachiData);
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public JsonResult Sleep()
        {
            Dachi dachi = HttpContext.Session.GetObjectFromJson <Dachi>("Dachi");

            dachi.sleep();
            HttpContext.Session.SetObjectAsJson("Dachi", dachi);
            return(Json(dachi));
        }
Beispiel #3
0
        public IActionResult Sleep()
        {
            Dachi DachiInfo = HttpContext.Session.GetObjectFromJson <Dachi>("DachiInfo");

            DachiInfo.sleep();
            HttpContext.Session.SetObjectAsJson("DachiInfo", DachiInfo);
            return(RedirectToAction("Index"));
        }
Beispiel #4
0
        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"));
        }
Beispiel #5
0
        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"));
        }