public ActionResult Play(int id)
        {
            Tamagotchi newTamagotchi = Tamagotchi.Find(id);

            newTamagotchi.Play();
            return(View("Details", newTamagotchi));
        }
Example #2
0
        public ActionResult Feed(int id)
        {
            Tamagotchi myPet = Tamagotchi.Find(id);

            myPet.Feed(myPet.GetFood() + 1);
            return(View("Show", myPet));
        }
        public ActionResult Love(int id)
        {
            Tamagotchi tama = Tamagotchi.Find(id);

            tama.SetHappiness(tama.GetHappiness() + 1);
            return(View("Details", tama));
        }
        public ActionResult Feed(int id)
        {
            Tamagotchi tama = Tamagotchi.Find(id);

            tama.SetFood(tama.GetFood() + 1);
            return(View("Details", tama));
        }
        public ActionResult Nap(int id)
        {
            Tamagotchi tama = Tamagotchi.Find(id);

            tama.SetSleep(tama.GetSleep() + 1);
            return(View("Details", tama));
        }
Example #6
0
        public ActionResult Play(int id)
        {
            Tamagotchi tama = Tamagotchi.Find(id);

            tama.Happiness++;
            return(View("Show", tama));
        }
Example #7
0
        public ActionResult Sleep(int id)
        {
            Tamagotchi tama = Tamagotchi.Find(id);

            tama.Sleep++;
            return(View("Show", tama));
        }
Example #8
0
        public ActionResult Feed(int id)
        {
            Tamagotchi tama = Tamagotchi.Find(id);

            tama.Food++;
            return(View("Show", tama));
        }
        public ActionResult Rest(int id)
        {
            Tamagotchi newTamagotchi = Tamagotchi.Find(id);

            newTamagotchi.Sleep();
            return(View("Details", newTamagotchi));
        }
        public ActionResult Index3(int id)
        {
            Tamagotchi.Find(id).GiveHappiness();
            List <Tamagotchi> allTamagotchies = Tamagotchi.GetAll();

            return(View("Index", allTamagotchies));
        }
Example #11
0
        public ActionResult ChangeEnergy(int id)
        {
            Tamagotchi foundTamagotchi = Tamagotchi.Find(id);

            foundTamagotchi.SleepLevel += 6;

            List <Tamagotchi> listTamagotchi = Tamagotchi.GetAll();

            foreach (Tamagotchi tamagotchi in listTamagotchi)
            {
                tamagotchi.FoodLevel      -= 1;
                tamagotchi.AttentionLevel -= 1;
                tamagotchi.SleepLevel     -= 1;
            }
            List <Tamagotchi> deadList = new List <Tamagotchi> {
            };

            foreach (Tamagotchi tamagotchi in listTamagotchi)
            {
                if (tamagotchi.FoodLevel == 0 | tamagotchi.AttentionLevel == 0 | tamagotchi.SleepLevel == 0)
                {
                    deadList.Add(tamagotchi);
                    return(View("Cemetary", deadList));
                }
            }

            return(View("Show", foundTamagotchi));
        }
        public ActionResult DeleteTama(int id)
        {
            Tamagotchi newTama         = Tamagotchi.Find(id);
            string     tamaToBeDeleted = newTama.name;

            Tamagotchi.Delete(newTama);
            return(View("Delete", tamaToBeDeleted));
        }
Example #13
0
        public ActionResult SleepID(int id)
        {
            Tamagotchi tamagotchi = Tamagotchi.Find(id);

            tamagotchi.SetSleep(2);
            List <Tamagotchi> allTamagotchis = Tamagotchi.GetAll();

            return(View("Index", allTamagotchis));
        }
        public ActionResult SleepID(int id)
        {
            Tamagotchi tamagotchi = Tamagotchi.Find(id);

            tamagotchi.SetSleep(2);
            List <Tamagotchi> allTamagotchis = Tamagotchi.GetAll();

            return(RedirectToAction("Index"));
        }
        public void Find_FindMyTamagotchi_Tamagotchi()
        {
            string     name        = "princess";
            string     name2       = "prince";
            Tamagotchi tamagotchi  = new Tamagotchi(name);
            Tamagotchi tamagotchi2 = new Tamagotchi(name2);

            Tamagotchi result = Tamagotchi.Find(2);

            Assert.AreEqual(tamagotchi2, result);
        }
Example #16
0
        public ActionResult ChangeFood(int id)
        {
            List <Tamagotchi> listTamagotchi = Tamagotchi.GetAll();

            foreach (Tamagotchi tamagotchi in listTamagotchi)
            {
                tamagotchi.FoodLevel      -= 1;
                tamagotchi.AttentionLevel -= 1;
                tamagotchi.SleepLevel     -= 1;
            }
            Tamagotchi foundTamagotchi = Tamagotchi.Find(id);

            foundTamagotchi.FoodLevel += 6;
            return(View("Show", foundTamagotchi));
        }
Example #17
0
        public HomeModule()
        {
            Get["/"]            = _ => View["index.cshtml"];
            Get["/create"]      = _ => View["create_a_tamagotchi.cshtml"];
            Post["/birth_form"] = _ => {
                Tamagotchi newTamagotchi = new Tamagotchi(Request.Form["new-name"]);
                return(View["tamagotchi.cshtml", newTamagotchi]);
            };
            Get["{tamagotchiName}passtime"] = parameters => {
                Tamagotchi tamagotchi = Tamagotchi.Find(parameters.tamagotchiName);
                tamagotchi.ActOnTamgagotchi("passtime");
                if (tamagotchi.GetHunger() <= 0 || tamagotchi.GetHappiness() <= 0 || tamagotchi.GetSleepiness() <= 0)
                {
                    return(View["/dead_tamagotchi.cshtml"]);
                }
                else
                {
                    return(View["/tamagotchi.cshtml", tamagotchi]);
                }
            };

            Get["{tamagotchiName}sleep"] = parameters => {
                Tamagotchi tamagotchi = Tamagotchi.Find(parameters.tamagotchiName);
                tamagotchi.ActOnTamgagotchi("sleep");
                return(View["/tamagotchi.cshtml", tamagotchi]);
            };
            Get["{tamagotchiName}feed"] = parameters => {
                Tamagotchi tamagotchi = Tamagotchi.Find(parameters.tamagotchiName);
                tamagotchi.ActOnTamgagotchi("feed");
                return(View["/tamagotchi.cshtml", tamagotchi]);
            };
            Get["{tamagotchiName}play"] = parameters => {
                Tamagotchi tamagotchi = Tamagotchi.Find(parameters.tamagotchiName);
                tamagotchi.ActOnTamgagotchi("play");
                return(View["/tamagotchi.cshtml", tamagotchi]);
            };
        }
Example #18
0
        public ActionResult Show(int id)
        {
            Tamagotchi tama = Tamagotchi.Find(id);

            return(View(tama));
        }
Example #19
0
        public ActionResult Show(int id)
        {
            Tamagotchi pet = Tamagotchi.Find(id);

            return(View(pet));
        }
Example #20
0
        public ActionResult Show(int id)
        {
            Tamagotchi foundTamagotchi = Tamagotchi.Find(id);

            return(View(foundTamagotchi));
        }
        public ActionResult Details(int id)
        {
            Tamagotchi newTama = Tamagotchi.Find(id);

            return(View(newTama));
        }