示例#1
0
            public AnimalHierarchy.Animal createAnimal(Random rGen)
            {
                AnimalHierarchy.Animal animal = null;

                switch (rGen.Next(MAX_ANIMALS.NORTH_AMERICA))
                {
                case 0:
                    animal = new AnimalHierarchy.Bison();
                    break;

                case 1:
                    animal = new AnimalHierarchy.Eagle();
                    break;

                case 2:
                    animal = new AnimalHierarchy.Platypus();
                    break;

                case 3:
                    animal = new AnimalHierarchy.Wolf();
                    break;
                }

                return(animal);
            }
示例#2
0
            public AnimalHierarchy.Animal createAnimal(Random rGen)
            {
                AnimalHierarchy.Animal animal = null;

                switch (rGen.Next(MAX_ANIMALS.NORTH_AMERICA))
                {
                    case 0:
                        animal = new AnimalHierarchy.Bison();
                        break;
                    case 1:
                        animal = new AnimalHierarchy.Eagle();
                        break;
                    case 2:
                        animal = new AnimalHierarchy.Platypus();
                        break;
                    case 3:
                        animal = new AnimalHierarchy.Wolf();
                        break;
                }

                return animal;
            }