// Simple Factory Method public static Laptop Get(LaptopTypeEnum type) { switch (type) { case LaptopTypeEnum.Dell: return(new Dell()); case LaptopTypeEnum.Mac: return(new Mac()); default: return(new Acer()); } }
public static Laptop Get(LaptopTypeEnum type) { switch (type) { case LaptopTypeEnum.Dell: return(new Dell()); case LaptopTypeEnum.Asus: return(new Asus()); case LaptopTypeEnum.Lenovo: return(new Lenovo()); case LaptopTypeEnum.Acer: default: return(new Acer()); } }
public Laptop(string name, LaptopTypeEnum laptopType) : base(name) { LaptopType = laptopType; computerDefinition = new ForMacOs(); }