Exemplo n.º 1
0
        public ActionResult BuryPet(int id)
        {
            TamagotchiPet pet = TamagotchiPet.Find(id);

            pet.Bury();
            List <TamagotchiPet> allPets = TamagotchiPet.GetAll();

            return(View("DisplayPetData", allPets));
        }
Exemplo n.º 2
0
        public ActionResult DisplayPetData(int id)
        {
            TamagotchiPet        pet           = TamagotchiPet.Find(id);
            List <TamagotchiPet> singlePetList = new List <TamagotchiPet>()
            {
                pet
            };

            return(View(singlePetList));
        }
Exemplo n.º 3
0
        public ActionResult AddRest(int id)
        {
            TamagotchiPet pet = TamagotchiPet.Find(id);

            pet.RestReplenish();
            return(Json(new {
                name = pet.GetName(),
                level = pet.GetLevel(),
                exp = pet.GetExp(),
                nextLevel = pet.GetNextLevel(),
                id = pet.GetId(),
                food = pet.GetFood(),
                attention = pet.GetAttention(),
                rest = pet.GetRest()
            }));
        }
Exemplo n.º 4
0
        public void Find_FindsTamagotchiPetById_TamagotchiPet()
        {
            TamagotchiPet pet = new TamagotchiPet("Tan");

            Assert.AreEqual(pet, TamagotchiPet.Find(1));
        }