public void PrintFurniture(IFurniture furniture) { Console.WriteLine(furniture.CreateArmchair().Name.ToString()); Console.WriteLine(furniture.CreateArmchair().Purpose()); Console.WriteLine(); Console.WriteLine(furniture.CreateTable().Name.ToString()); Console.WriteLine(furniture.CreateTable().Purpose()); Console.WriteLine(); Console.WriteLine(furniture.CreateSofa().Name.ToString()); Console.WriteLine(furniture.CreateSofa().Purpose()); Console.WriteLine(); Console.WriteLine(); }
public Clients(IFurniture furniture, string segment) { chair = furniture.CreateChair(segment); table = furniture.CreateTable(segment); sofa = furniture.CreateSofa(segment); }