public void Initialize(string Name) { this.Name = Name; // Simulate going to database to retreive more complex initialization info AnimalInfo animal = AnimalInfoDatabase.Find(this.GetType().Name); MaxAge = animal.MaxAge; Message = animal.Message; }
public static AnimalInfo Find(string AnimalType) { AnimalInfo found = null; foreach (AnimalInfo animal in AnimalRecords) { if (animal.AnimalType == AnimalType) { found = animal; break; } } return(found); }