Пример #1
0
 public void SetData(string name, int age, TypeOfPet type, string species, string taste)
 {
     base.Name    = name;
     base.Age     = age;
     base.Type    = type;
     this.Species = species;
     this.Taste   = taste;
 }
Пример #2
0
        public Pets(string name, int age, TypeOfPet typeOfPet)
        {
            Name = name;
            Age  = age;
            Type = typeOfPet;
            switch (typeOfPet)
            {
            case TypeOfPet.Dog:
                _isFriendly = true;
                break;

            case TypeOfPet.Cat:
                _isFriendly = true;
                break;

            default:
                _isFriendly = false;
                break;
            }
        }
Пример #3
0
        public static Product CreateProduct(string name, string description, decimal price, int initial_quantity = 0, TypeOfPet pet = TypeOfPet.Dog)
        {
            var product = new Product
            {
                Name        = name,
                Description = description,
                Price       = price,
                Pet         = pet,
            };

            if (initial_quantity > 0)
            {
                product.Input(initial_quantity);
            }
            return(product);
        }
Пример #4
0
 public void SetData(string name, int age, TypeOfPet type)
 {
     base.Name = name;
     base.Age  = age;
     base.Type = type;
 }
Пример #5
0
 public Dog(string name, int age, TypeOfPet type, string species, string taste) : base()
 {
     SetData(name, age, type, species, taste);
 }
Пример #6
0
 public Dog(string name, int age, TypeOfPet type) : base()
 {
     SetData(name, age, type);
 }
Пример #7
0
 public void SetData(string name, int age, TypeOfPet type)
 {
     this.Name = name;
     this.Age  = age;
     this.Type = type;
 }
Пример #8
0
 public Pet(string name, int age, TypeOfPet type, string species, string taste) : this()
 {
     SetData(name, age, type);
 }