Example #1
0
        public Computer CreatePC(int cpuType, int coreCount, int ramSize, int hardCount, int hardCapacity)
        {
            IRAM ram = new RAM(ramSize);
            ICPU cpu;

            switch (cpuType)
            {
            case 32:
                cpu = new CPU32(ram, coreCount);
                break;

            case 64:
                cpu = new CPU64(ram, coreCount);
                break;

            case 128:
                cpu = new CPU128(ram, coreCount);
                break;

            default:
                break;
            }
            IVideoCard   videoCard     = new ColorfulVideoCard();
            IMotherboard motherBoard   = new MotherBoard();
            RAID         hardDriveRaid = new RAID();

            for (int i = 0; i < hardCount; i++)
            {
                HardDrive currentHardDrive = new HardDrive(hardCapacity, true);
                hardDriveRaid.AddHardDrive(currentHardDrive);
            }
            Computer pc = new PC(cpu, ram, videoCard, hardDriveRaid, motherBoard);

            return(pc);
        }
Example #2
0
 public Computer CreateServer(int cpuType, int coreCount, int ramSize, int hardCount, int hardCapacity)
 {
     IRAM ram = new RAM(ramSize);
     ICPU cpu;
     switch (cpuType)
     {
         case 32:
             cpu = new CPU32(ram, coreCount);
             break;
         case 64:
             cpu = new CPU64(ram, coreCount);
             break;
         case 128:
             cpu = new CPU128(ram, coreCount);
             break;
         default:
             break;
     }
     IVideoCard videoCard = new MonochromeVideoCard();
     IMotherboard motherBoard = new MotherBoard();
     RAID hardDriveRaid = new RAID();
     IBattery battery = new LaptopBattery();
     for (int i = 0; i < hardCount; i++)
     {
         HardDrive currentHardDrive = new HardDrive(hardCapacity, true);
         hardDriveRaid.AddHardDrive(currentHardDrive);
     }
     Computer server = new Server(cpu, ram, videoCard, hardDriveRaid, motherBoard);
     return server;
 }
Example #3
0
 public Computer CreatePC(int cpuType, int coreCount, int ramSize, int hardCount, int hardCapacity)
 {
     IRAM ram = new RAM(ramSize);
     ICPU cpu;
     switch (cpuType)
     {
         case 32:
             cpu = new CPU32(ram, coreCount);
             break;
         case 64:
             cpu = new CPU64(ram, coreCount);
             break;
         case 128:
             cpu = new CPU128(ram, coreCount);
             break;
         default:
             break;
     }
     IVideoCard videoCard = new ColorfulVideoCard();
     IMotherboard motherBoard = new MotherBoard();
     RAID hardDriveRaid = new RAID();
     for (int i = 0; i < hardCount; i++)
     {
         HardDrive currentHardDrive = new HardDrive(hardCapacity, true);
         hardDriveRaid.AddHardDrive(currentHardDrive);
     }
     Computer pc = new PC(cpu, ram, videoCard, hardDriveRaid, motherBoard);
     return pc;
 }
        private ICpu CreateCpu(int cpuBit, byte cpuCores)
        {
            ICpu cpu;

            switch (cpuBit)
            {
            case 64:
                cpu = new CPU64(cpuCores);
                break;

            case 128:
                cpu = new CPU128(cpuCores);
                break;

            default:
                cpu = new CPU32(cpuCores);
                break;
            }

            return(cpu);
        }
Example #5
0
        public Computer CreateServer(int cpuType, int coreCount, int ramSize, int hardCount, int hardCapacity)
        {
            IRAM ram = new RAM(ramSize);
            ICPU cpu;

            switch (cpuType)
            {
            case 32:
                cpu = new CPU32(ram, coreCount);
                break;

            case 64:
                cpu = new CPU64(ram, coreCount);
                break;

            case 128:
                cpu = new CPU128(ram, coreCount);
                break;

            default:
                break;
            }
            IVideoCard   videoCard     = new MonochromeVideoCard();
            IMotherboard motherBoard   = new MotherBoard();
            RAID         hardDriveRaid = new RAID();
            IBattery     battery       = new LaptopBattery();

            for (int i = 0; i < hardCount; i++)
            {
                HardDrive currentHardDrive = new HardDrive(hardCapacity, true);
                hardDriveRaid.AddHardDrive(currentHardDrive);
            }
            Computer server = new Server(cpu, ram, videoCard, hardDriveRaid, motherBoard);

            return(server);
        }