static void Main(string[] args) { var workplace = WorkplaceBuilder .Begin() .SetChair(new BlackChair()) .SetADesk(DeskType.Executive, 100, 150, 100) .AddOptional(new Flower("Yellow")) .Build(); workplace.Describe(); var inMiddle = WorkplaceBuilder .Begin() .SetChair(new NormalChair()); inMiddle.SetADesk(DeskType.Computer, 100, 120, 99) .AddOptional(new Photo("John Doe")) .AddOptional(new Photo("John Doe")) .AddOptional(new Photo("John Doe")) .Build() .Describe(); inMiddle.SetADesk(DeskType.Corner, 50, 50, 99) .Build() .Describe(); Console.ReadKey(); }
private WorkplaceBuilder(WorkplaceBuilder other) { this.optionals = other.optionals.Clone(); this.deskType = other.deskType; this.width = other.width; this.height = other.height; this.length = other.length; this.chair = other.chair; this.employeeName = other.employeeName; }