コード例 #1
0
 public Furniture1(int id, double price, string name, EFurnitureComplexity furnitureComplexity, IMaterialAccesory materialAccesory)
 {
     Id    = id;
     Name  = name;
     Price = price;
     FurnitureComplexity = furnitureComplexity;
     MaterialAccesory    = materialAccesory;
 }
コード例 #2
0
 public SofaBed(int id, double price, string name, EFurnitureComplexity furnitureComplexity, IMaterialAccesory materialMixBuilder, EFurnitureType furnitureType) :
     base(id, price, name, furnitureComplexity, materialMixBuilder)
 {
     FurnitureType = furnitureType;
 }
コード例 #3
0
 public override Furniture1 GetFurniture(double price, string name, EFurnitureComplexity furnitureComplexity, IMaterialAccesory materialMixBuilder, EFurnitureType furnitureType)
 => new LiftChair(LastId++, price, name, furnitureComplexity, materialMixBuilder, EFurnitureType.EBarChair);
コード例 #4
0
 public abstract Furniture1 GetFurniture(double price, string Name, EFurnitureComplexity furnitureComplexity, IMaterialAccesory materialMixBuilder, EFurnitureType furnitureType);
コード例 #5
0
        public int OrderFurniture(double price, string name, EFurnitureComplexity furnitureComplexity, IMaterialAccesory materialMixBuilder, EFurnitureType furnitureType)
        {
            Furniture1       furniture;
            FurnitureFactory furnitureFactory;

            switch (furnitureType)
            {
            case EFurnitureType.EBarChair:
            {
                furnitureFactory = new BarChairFactory();
                break;
            }

            case EFurnitureType.EBed:
            {
                furnitureFactory = new BedFactory();
                break;
            }

            case EFurnitureType.EBench:
            {
                furnitureFactory = new BenchFactory();
                break;
            }

            case EFurnitureType.EBiliardTable:
            {
                furnitureFactory = new BiliardTableFactory();
                break;
            }

            case EFurnitureType.EChair:
            {
                furnitureFactory = new ChairFactory();
                break;
            }

            case EFurnitureType.EChesterField:
            {
                furnitureFactory = new ChesterFieldFactory();
                break;
            }

            case EFurnitureType.ECoffeTable:
            {
                furnitureFactory = new CoffeTableFactory();
                break;
            }

            case EFurnitureType.ECouch:
            {
                furnitureFactory = new Couchfactory();
                break;
            }

            case EFurnitureType.EDayBed:
            {
                furnitureFactory = new DayBedFactory();
                break;
            }

            case EFurnitureType.EDiningTable:
            {
                furnitureFactory = new DiningTableFactory();
                break;
            }

            case EFurnitureType.ELiftChair:
            {
                furnitureFactory = new LiftChairFactory();
                break;
            }

            case EFurnitureType.ESofaBed:
            {
                furnitureFactory = new SofaBedFactory();
                break;
            }

            case EFurnitureType.ETelevisionSet:
            {
                furnitureFactory = new TelevisionSetFactory();
                break;
            }

            default:
            {
                Console.WriteLine("Unknown furniture type!");
                return(0);
            }
            }
            furniture = furnitureFactory.GetFurniture(price, name, furnitureComplexity, materialMixBuilder, furnitureType);
            OrderedFurniture.Add(furniture.Id, furniture);
            return(furniture.Id);
        }