public PC CreatePC(int ram, VideoCardTypes videoCardType, int[] hardDriveCapacity, int cpuBit, byte cpuCores) { var PCRam = new Ram(ram); var PCVideoCard = this.CreateVideoCard(videoCardType); var PCHardDrives = hardDriveCapacity.Select(x => new HardDriver(x)); var PCCPU = this.CreateCpu(cpuBit, cpuCores); return(new PC(PCCPU, PCRam, PCVideoCard, PCHardDrives)); }
public Laptop CreateLaptop(int ram, VideoCardTypes videoCardType, int[] hardDrivesCapacity, int cpuBit, byte cpuCores) { var laptopRam = new Ram(ram); var laptopVideoCard = this.CreateVideoCard(videoCardType); var laptopHardDrives = hardDrivesCapacity.Select(x => new HardDriver(x)); var laptopCPU = this.CreateCpu(cpuBit, cpuCores); return(new Laptop(laptopCPU, laptopRam, laptopVideoCard, laptopHardDrives)); }
private IVideoCard CreateVideoCard(VideoCardTypes type) { IVideoCard videoCard; if (type == VideoCardTypes.ColorFul) { videoCard = new ColorfulVideoCard(); } else { videoCard = new MonochromeVideoCard(); } return(videoCard); }