Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        public static AnimalInfo Find(string AnimalType)
        {
            AnimalInfo found = null;

            foreach (AnimalInfo animal in AnimalRecords)
            {
                if (animal.AnimalType == AnimalType)
                {
                    found = animal;
                    break;
                }
            }
            return(found);
        }