public void Construct(IPhoneBuilder builder)
 {
     builder.BuildBattery();
     builder.BuildCamera();
     builder.BuildOS();
     builder.BuildRam();
 }
 public void Construct(IPhoneBuilder phoneBuilder)
 {
     phoneBuilder.BuildBattery();
     phoneBuilder.BuildOS();
     phoneBuilder.BuildScreen();
     phoneBuilder.BuildStylus();
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            //Cria o Fabricante
            Fabricante fabricante = new Fabricante();

            //Permite qua a classe Builder esteja pronta
            ICelular celularBuilder = null;

            //Agora vamos criar um celular Android
            celularBuilder = new IPhoneBuilder();
            fabricante.Construtor(celularBuilder);

            Console.Write("Fabricado o celular: " + celularBuilder.Celular.Nome);

            Console.ReadLine();
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Manufacturer  manufacturer = new Manufacturer();
            IPhoneBuilder phone        = null;

            phone = new AndroidPhoneBuilder();
            manufacturer.Construct(phone);

            Console.WriteLine("Phone Built with specifications - " + phone.Phone.ToString());

            phone = new WindowsPhoneBuilder();
            manufacturer.Construct(phone);

            Console.WriteLine("Phone built with specifications - " + phone.Phone.ToString());
            Console.ReadLine();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Manufacturer manuf = new Manufacturer();

            AndroidPhoneBuilder aBuilder = new AndroidPhoneBuilder();
            Phone aPhone = manuf.Produce(aBuilder);

            Console.WriteLine(aPhone.ToString());

            IPhoneBuilder iBuilder = new IPhoneBuilder();
            Phone         iPhone   = manuf.Produce(iBuilder);

            Console.WriteLine(iPhone.ToString());

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            // Lets create the Director first
            Manufacturer newManufacturer = new Manufacturer();
            // Lets have the Builder class ready
            IPhoneBuilder phoneBuilder = null;

            // Now let us create an android phone
            phoneBuilder = new AndroidPhoneBuilder();
            newManufacturer.Construct(phoneBuilder);
            Console.WriteLine("A new Phone built:\n\n{0}", phoneBuilder.Phone.ToString());

            // Now let us create a Windows Phone
            phoneBuilder = new WindowsPhoneBuilder();
            newManufacturer.Construct(phoneBuilder);
            Console.WriteLine("A new Phone built:\n\n{0}", phoneBuilder.Phone.ToString());
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Builder!");

            // Create Manufacturer
            Manufacturer manufacturer = new Manufacturer();

            // Allows the Builder class to be ready
            ICellPhone celluarBuild = null;

            // Let's create a Android cellphone
            celluarBuild = new IPhoneBuilder(); //AndroidBuilder();
            manufacturer.Constructor(celluarBuild);
            Console.WriteLine("A new cell phone was built by: {0}", celluarBuild.CellPhone.Name);
            Console.WriteLine("Camera: {0}", celluarBuild.CellPhone.Camera);
            Console.WriteLine("OS: {0}", celluarBuild.CellPhone.OperationaSystem);
            Console.WriteLine("Screen: {0}", celluarBuild.CellPhone.Screen);
            Console.WriteLine("Batrery: {0}", celluarBuild.CellPhone.Battery);

            Console.ReadKey();
        }
Beispiel #8
0
 public void Construct(IPhoneBuilder phoneBuilder)
 {
     phoneBuilder.BuildScreen();
     phoneBuilder.BuildOperatingSystem();
     phoneBuilder.BuildStylus();
 }