Example #1
0
        public IActionResult NutritionStore(string something)
        {
            PetEnvironmentViewModel vm = new PetEnvironmentViewModel(pets, foodAndDrinks);

            vm.Pets.GetSelectedPet().ImageURL = "http://www.videogamesprites.net/FinalFantasy6/Party/Mog/Mog%20-%20Victory%20(Left).gif";
            return(View(vm));
        }
Example #2
0
        public IActionResult Buy([FromForm] string foodName, [FromForm] string drinkName)
        {
            PetEnvironmentViewModel vm = new PetEnvironmentViewModel(pets, foodAndDrinks);

            vm.Pets.GetSelectedPet().AddToInventory(foodName);
            if (vm.Pets.GetSelectedPet().Purchase() > 0)
            {
                vm.Pets.GetSelectedPet().Purchase();
                return(RedirectToAction("Pet", new { chosenName = pets.GetSelectedPet().Name }));
            }
            else
            {
                return(RedirectToAction("NutritionStore"));
            }
        }
Example #3
0
        public IActionResult Pet([FromQuery] string chosenName)
        {
            Pet chosenPet;

            chosenPet = pets.GetList().Find(p => p.Name == chosenName);

            if (chosenPet == null && chosenName != null)
            {
                chosenPet = new Pet(chosenName);
                pets.AddToList(chosenPet);
            }

            pets.SetSelectedPet(chosenPet);

            PetEnvironmentViewModel vm = new PetEnvironmentViewModel(pets, foodAndDrinks);

            vm.Pets.GetSelectedPet().ImageURL = "http://www.videogamesprites.net/FinalFantasy6/Party/Mog/Mog%20-%20Walk%20(Front).gif";

            return(View(vm));
        }
Example #4
0
        public IActionResult Login()
        {
            PetEnvironmentViewModel vm = new PetEnvironmentViewModel(pets, foodAndDrinks);

            return(View(vm));
        }