Пример #1
0
        public AnimalModel ChoiceAnimal(int isSheep)
        {
            var         type = (AnimalType)isSheep;
            AnimalModel animal;

            switch (type)
            {
            case AnimalType.SHEEP:
                animal = SheepModel.GetSheep();
                return(animal);

            case AnimalType.WOLF:
                animal = WolfModel.GetWolf();
                return(animal);

            case AnimalType.DUCK:
                animal = DuckModel.GetDuck();
                return(animal);

            case AnimalType.HUNTER:
                animal = HunterModel.GetHunter();
                return(animal);

            default: break;
            }
            return(null);
        }
Пример #2
0
        public static AnimalModel GetWolf()
        {
            var wolf = new WolfModel();

            wolf.Id  = Guid.NewGuid().ToString();
            wolf.URL = GetRandomImage();
            return(wolf);
        }