示例#1
0
 public Computer CreateLaptop(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();
     IBattery battery = new LaptopBattery();
     for (int i = 0; i < hardCount; i++)
     {
         HardDrive currentHardDrive = new HardDrive(hardCapacity, true);
         hardDriveRaid.AddHardDrive(currentHardDrive);
     }
     Computer laptop = new Laptop(cpu, ram, videoCard, hardDriveRaid, motherBoard, battery);
     return laptop;
 }
示例#2
0
 public void RemoveHardDrive(HardDrive driveToRemove)
 {
     HardDrivesList.Remove(driveToRemove);
 }
示例#3
0
 public void AddHardDrive(HardDrive newDrive)
 {
     HardDrivesList.Add(newDrive);
 }
示例#4
0
 public void RemoveHardDrive(HardDrive driveToRemove)
 {
     HardDrivesList.Remove(driveToRemove);
 }
示例#5
0
 public void AddHardDrive(HardDrive newDrive)
 {
     HardDrivesList.Add(newDrive);
 }