示例#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 GetSheep()
        {
            var sheep = new SheepModel();

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