Esempio n. 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);
        }
Esempio n. 2
0
        public static AnimalModel GetDuck()
        {
            var duck = new DuckModel();

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