Exemplo n.º 1
0
        public static void RandomFactoryExmples(Random random)
        {
            RandomDinosaurFactory rf1      = new RandomDinosaurFactory(random);
            IDinosaur             dinosaur = rf1.CreateADinosaur();

            dinosaur.MakeANoise();
        }
        public void MakeADinosaurNoise()
        {
            IDinosaur dinosaur = this.dinosaurFactory.CreateADinosaur();

            if (dinosaur != null)
            {
                dinosaur.MakeANoise();
            }
        }
Exemplo n.º 3
0
        public void MakeADinosaurNoise()
        {
            IDinosaur dinosaur = MakeADinosaur();

            dinosaur.MakeANoise();
        }