Example #1
0
        static void Main(string[] args)
        {
            Monitor lgMonitor = new Monitor("1200x600", true, 31);
            Printer hpPrinter = new Printer("HP", "MP102", 50);

            Vga       nvdiaVga       = new Vga("Nvidia", 2054, 2054);
            Ram       samsungRam     = new Ram("DDR4", 5000, 8000);
            Processor intelProcessor = new Processor();

            intelProcessor.setCache(254);
            intelProcessor.setCore(8);
            intelProcessor.setSeries("CORE i7 8th Gen");

            Computer computer = new Computer.Builder(samsungRam, nvdiaVga, intelProcessor).withMonitor(lgMonitor).withPrinter(hpPrinter).build();

            Console.WriteLine(computer.ToString());
        }
 public Builder(Ram ram, Vga vga, Processor processor)
 {
     this.ram       = ram;
     this.vga       = vga;
     this.processor = processor;
 }