public Parrot(ParrotTypeEnum type, int numberOfCoconuts, double voltage, bool isNailed)
 {
     this.type = type;
     this.numberOfCoconuts = numberOfCoconuts;
     this.voltage = voltage;
     this.isNailed = isNailed;
 }
Exemple #2
0
 public Parrot(ParrotTypeEnum type, int numberOfCoconuts, double voltage, bool isNailed)
 {
     _type             = ParrotType.NewType(type);
     _numberOfCoconuts = numberOfCoconuts;
     _voltage          = voltage;
     _isNailed         = isNailed;
 }
Exemple #3
0
 public Parrot(ParrotTypeEnum type, int numberOfCoconuts, double voltage, bool isNailed)
 {
     this.m_Type             = type;
     this.m_NumberOfCoconuts = numberOfCoconuts;
     this.m_Voltage          = voltage;
     this.m_IsNailed         = isNailed;
 }
Exemple #4
0
 public static Parrot Create(ParrotTypeEnum type)
 {
     if (type == ParrotTypeEnum.EUROPEAN)
     {
         return(new EuropeanParrot());
     }
     throw new Exception("More paramaters needed");
 }
        public static Parrot Create(ParrotTypeEnum type, int numberOfCoconuts, double voltage, bool isNailed, double baseSpeed)
        {
            switch (type)
            {
            case ParrotTypeEnum.EUROPEAN:
                return(new EuropeanParrot(numberOfCoconuts, voltage, isNailed, baseSpeed));

            case ParrotTypeEnum.AFRICAN:
                return(new AfricanParrot(numberOfCoconuts, voltage, isNailed, baseSpeed));

            case ParrotTypeEnum.NORWEGIAN_BLUE:
                return(new NorweigenBlue(numberOfCoconuts, voltage, isNailed, baseSpeed));
            }
            return(new Parrot(numberOfCoconuts, voltage, isNailed, baseSpeed));
        }
Exemple #6
0
        public static Parrot Create(ParrotTypeEnum type, int numberOfCoconuts = 0, double voltage = 0, bool isNailed = false)
        {
            switch (type)
            {
            case ParrotTypeEnum.EUROPEAN:
                return(new EuropeanParrot());

            case ParrotTypeEnum.NORWEGIAN_BLUE:
                return(new NorwegianParrot(isNailed, voltage));

            case ParrotTypeEnum.AFRICAN:
                return(new AfricanParrot(numberOfCoconuts));

            default:
                throw new Exception("Unknown parrot type");
            }
        }
        public static ParrotType NewType(ParrotTypeEnum typeCode)
        {
            switch (typeCode)
            {
            case ParrotTypeEnum.EUROPEAN:
                return(new EuropeanParrot());

            case ParrotTypeEnum.AFRICAN:
                return(new AfricanParrot());

            case ParrotTypeEnum.NORWEGIAN_BLUE:
                return(new NorwegianBlueParrot());

            default:
                throw new ArgumentException("Incorrect parrot code");
            }
        }
Exemple #8
0
 public static Parrot Create(ParrotTypeEnum typeEnum, int numberOfCoconuts)
 {
     return(new AfricanParrot(numberOfCoconuts));
 }
Exemple #9
0
 public static Parrot Create(ParrotTypeEnum type, double voltage, bool isNailed)
 {
     return(new NorwegianParrot(isNailed, voltage));
 }
 private Parrot Create(ParrotTypeEnum type, int numberOfCoconuts, double voltage, bool isNailed, double baseSpeed)
 {
     return(Parrot.Create(type, numberOfCoconuts, voltage, isNailed, baseSpeed));
 }