Ejemplo n.º 1
0
        /// <summary>
        /// Adds a hard drive into the motherboard
        /// </summary>
        /// <param name="hardDrive">The hard drive</param>
        /// <returns>The motherboard with a new hard drive</returns>
        public IMotherboard <Motherboard> AddHardDrive(HardDrive hardDrive)
        {
            // Has the motherboard passed it's hard drive limit
            if (this.motherboard.HardDriveLimit >= this.motherboard.HardDrives.Count())
            {
                Console.WriteLine("Hard drive capacity is full. Please remove one if you wish to add a new one.");
                return(this);
            }

            this.motherboard.HardDrives.Add(hardDrive);

            // Check if the motherboard has reached it's hard drive limit
            if (this.motherboard.HardDriveLimit == this.motherboard.HardDrives.Count())
            {
                Console.WriteLine($"Mother board has reached it's hard drive capacity.");
            }

            return(this);
        }
Ejemplo n.º 2
0
 public ComputerBuilder addHardDrive(HardDrive hardDrive)
 {
     computer.HardDrive = hardDrive;
     return(this);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes the Computer with a predefined motherboard, harddrive, and case
 /// </summary>
 /// <param name="motherboard">The motherboard</param>
 /// <param name="hardDrive">The harddrive</param>
 /// <param name="case">The casee</param>
 public Computer(Motherboard motherboard, HardDrive hardDrive, Case @case)
 {
     Motherboard = motherboard;
     HardDrive   = hardDrive;
     Case        = @case;
 }