You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Builder.Products;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Builder.Builder
|
|
|
|
|
{
|
|
|
|
|
internal class ConcreteBuilder : IBuilder
|
|
|
|
|
{
|
|
|
|
|
private Product _product = new Product();
|
|
|
|
|
|
|
|
|
|
public ConcreteBuilder()
|
|
|
|
|
{
|
|
|
|
|
Reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Reset()
|
|
|
|
|
{
|
|
|
|
|
_product = new Product();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void BuildPartA()
|
|
|
|
|
{
|
|
|
|
|
_product.Add("PartA1");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void BuildPartB()
|
|
|
|
|
{
|
|
|
|
|
_product.Add("PartB1");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void BuildPartC()
|
|
|
|
|
{
|
|
|
|
|
_product.Add("PartC1");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Product GetProduct()
|
|
|
|
|
{
|
|
|
|
|
Product product = _product;
|
|
|
|
|
Reset();
|
|
|
|
|
|
|
|
|
|
return product;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|