public override void Remove(Component component) { _children.Remove(component); }
public Computer(Component CPU, Component GPU, Component Mobo, Component Disk, Component PSU, Component Case, Component RAM) { this.RAM = RAM; this.Processor = CPU; this.GPU = GPU; this.Motherboard = Mobo; this.Disk = Disk; this.Case = Case; this.PSU = PSU; this.Price = this.Processor.Price + this.GPU.Price + this.Motherboard.Price + this.Disk.Price + this.PSU.Price + this.RAM.Price + this.Case.Price; }
public override void Add(Component component) { _children.Add(component); }
public abstract void Remove(Component c);
public abstract void Add(Component c);
public override void Remove(Component c) { Console.WriteLine("Cannot remove from a leaf"); }
public override void Add(Component c) { Console.WriteLine("Cannot add to a leaf"); }