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

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

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

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

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

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

                switch (rGen.Next(MAX_ANIMALS.AUSTALIA))
                {
                    case 0:
                        animal = new AnimalHierarchy.Kangaroo();
                        break;
                    case 1:
                        animal = new AnimalHierarchy.Crocodile();
                        break;
                    case 2:
                        animal = new AnimalHierarchy.Koala();
                        break;
                    case 3:
                        animal = new AnimalHierarchy.Snake();
                        break;
                }

                return animal;
            }