public ActionResult Play(int id) { Tamagotchi newTamagotchi = Tamagotchi.Find(id); newTamagotchi.Play(); return(View("Details", newTamagotchi)); }
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)); }
public ActionResult Play(int id) { Tamagotchi tama = Tamagotchi.Find(id); tama.Happiness++; return(View("Show", tama)); }
public ActionResult Sleep(int id) { Tamagotchi tama = Tamagotchi.Find(id); tama.Sleep++; return(View("Show", tama)); }
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)); }
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)); }
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); }
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)); }
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]); }; }
public ActionResult Show(int id) { Tamagotchi tama = Tamagotchi.Find(id); return(View(tama)); }
public ActionResult Show(int id) { Tamagotchi pet = Tamagotchi.Find(id); return(View(pet)); }
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)); }