Пример #1
0
        protected override ICinema CreateCinema()
        {
            IRelay  projector, lamp1;
            IEngine engine1;

            projector = new RelayNoolite();
            lamp1     = new RelayNoolite();
            engine1   = new StepMotor();
            return(new CinemaFlat(lamp1, projector, engine1));
        }
Пример #2
0
        protected override ICinema CreateCinema()
        {
            IRelay  projector, lamp1, lamp2;
            IEngine engine1, engine2;

            projector = new RelayNoolite();
            lamp1     = new RelayNoolite();
            lamp2     = new RelayNoolite();
            engine1   = new StepMotor();
            engine2   = new StepMotor();
            return(new CinemaCottadge(projector, lamp1, lamp2, engine1, engine2));
        }
Пример #3
0
        static ICinema CreateCinema(CinemaType ct,
                                    EquipmentType et)
        {
            IRelay  projector, lamp1, lamp2;
            IEngine engine1, engine2;

            if (et == EquipmentType.Noolite)
            {
                projector = new RelayNoolite();
                lamp1     = new RelayNoolite();
                lamp2     = new RelayZWave();
                engine1   = new StepMotor();
                engine2   = new StepMotor();
            }
            else
            {
                projector = new RelayZWave();
                lamp1     = new RelayZWave();
                lamp2     = new RelayZWave();
                engine1   = new Motor();
                engine2   = new Motor();
            }
            if (ct == CinemaType.flat)
            {
                return(new CinemaFlat(lamp1, projector, engine1));
            }
            else if (ct == CinemaType.cottadge)
            {
                return(new CinemaCottadge(projector, lamp1, lamp2,
                                          engine1, engine2));
            }
            else
            {
                return(null);
            }
        }