Example #1
0
 public void RemoveLife(PetInfoProperties _petInfo)
 {
     _petInfo.pet.Life--;
     if (_petInfo.pet.Life < 0)
     {
         _petInfo.pet.Life = 0;
     }
     PetCreator.SavePetInfo(_petInfo.pet);
 }
Example #2
0
        public void ShouldBuildOpenApiObject()
        {
            //Arrange
            var pet = new PetCreator().Create();

            //Act
            var openApiObject = new OpenApiObjectBuilder(new OpenApiObjectConverter(new SchemaSettings())).Build(pet);

            //Assert
            Assert.AreEqual(openApiObject.Count, 17);
        }
Example #3
0
 public void AddLife()
 {
     for (int i = 0; i < allPets.Count; i++)
     {
         if (allPets[i].pet.Hungry >= 100 && allPets[i].pet.Life < 100)
         {
             allPets[i].pet.Life++;
             PetCreator.SavePetInfo(allPets[i].pet);
         }
     }
 }
Example #4
0
 public void RemoveCleanness()
 {
     for (int i = 0; i < allPets.Count; i++)
     {
         allPets[i].pet.Cleanness--;
         if (allPets[i].pet.Cleanness <= 0)
         {
             allPets[i].pet.Cleanness = 0;
             RemoveLife(allPets[i]);
         }
         PetCreator.SavePetInfo(allPets[i].pet);
     }
 }
Example #5
0
 public void RemoveHungry()
 {
     for (int i = 0; i < allPets.Count; i++)
     {
         allPets[i].pet.Hungry--;
         if (allPets[i].pet.Hungry <= 0)
         {
             allPets[i].pet.Hungry = 0;
             RemoveLife(allPets[i]);
         }
         PetCreator.SavePetInfo(allPets[i].pet);
     }
 }
Example #6
0
 public void LoadPetByTarget(GameObject obj, string targetName)
 {
     if (HasPet(targetName) == false)
     {
         PetInfoProperties newPet = new PetInfoProperties
         {
             pet    = PetCreator.GetPetByTargetName(targetName),
             petObj = obj
         };
         allPets.Add(newPet);
     }
     else
     {
         print("esta mascota ya la tienes aƱadida");
     }
 }