public static void UpdatePregnancy() { AnimalUtility .FindAnimals(a => a.GetDaysUntilBirth().HasValue) .ToList() .ForEach(a => a.SetDaysUntilBirth(a.GetDaysUntilBirth().Value - 1)); }
public static Character ContestParticipant(SDate contestDate) { Pet pet = Game1.player.getPet(); return(pet.GetDayParticipatedContest() == contestDate ? (Character)pet : AnimalUtility.FindAnimals(a => a.GetDayParticipatedContest() == contestDate).FirstOrDefault()); }
public static IEnumerable <FarmAnimal> AnimalsReadyForBirthTomorrow() { return(AnimalUtility.FindAnimals( a => { int?daysUntilBirth = a.GetDaysUntilBirth(); return daysUntilBirth.HasValue && daysUntilBirth.Value == 1; } )); }