public void RemoveLife(PetInfoProperties _petInfo) { _petInfo.pet.Life--; if (_petInfo.pet.Life < 0) { _petInfo.pet.Life = 0; } PetCreator.SavePetInfo(_petInfo.pet); }
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); }
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); } } }
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); } }
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); } }
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"); } }