public IPhone8Plus(IColor color, IBattery battery, IQuickCharge quickcharge) : base(color, battery, quickcharge) { _color = new BlackColor(); _battery = new NormalBattery(); _quickcharge = new Charge30(); _model = "IPhone 8 Plus"; }
public OppoF11Pro(IColor color, IBattery battery, IQuickCharge quickcharge) : base(color, battery, quickcharge) { _model = "Oppo F11 Pro"; _color = new BlackColor(); _battery = new NormalBattery(); _quickcharge = new Charge40(); }
public SamsungNote10(IColor color, IBattery battery, IQuickCharge quickcharge) : base(color, battery, quickcharge) { _model = "Samsung Note 10"; _color = new GoldColor(); _battery = new StrongBattery(); _quickcharge = new Charge40(); }
public SamsungS20(IColor color, IBattery battery, IQuickCharge quickcharge) : base(color, battery, quickcharge) { _model = "Samsung S 20"; _color = new BlackColor(); _battery = new NormalBattery(); _quickcharge = new Charge30(); }
public OppoFindX2(IColor color, IBattery battery, IQuickCharge quickcharge) : base(color, battery, quickcharge) { _model = "Oppo Find X2"; _color = new GoldColor(); _battery = new StrongBattery(); _quickcharge = new Charge40(); }
public IPhoneSE2(IColor color, IBattery battery, IQuickCharge quickcharge) : base(color, battery, quickcharge) { _color = new GoldColor(); _battery = new StrongBattery(); _quickcharge = new Charge40(); _model = "IPhone SE 2"; }
static void Main(string[] args) { Console.WriteLine("Welcome to Phi Long Technology!"); Console.ReadLine(); Console.WriteLine("This is a High-end smartphone of Samsung Factory"); ICellPhoneFactory cellPhoneFactory = new SamsungFactory(); ICellPhone samsung = cellPhoneFactory.GetHighEnd(); IColor color = samsung.GetColor(); IBattery battery = samsung.GetBattery(); IQuickCharge quickcharge = samsung.GetQuickCharge(); Console.WriteLine(color.GetColorType()); Console.WriteLine(battery.GetBatteryType()); Console.WriteLine(quickcharge.GetQuickChargeType()); Console.ReadLine(); Console.WriteLine("------------------------------------------"); Console.ReadLine(); Console.WriteLine("This is a Mid-range smartphone of Oppo Factory"); ICellPhoneFactory cellPhoneFactory2 = new OppoFactory(); ICellPhone oppo = cellPhoneFactory.GetMidRange(); IColor color2 = oppo.GetColor(); IBattery battery2 = oppo.GetBattery(); IQuickCharge quickcharge2 = oppo.GetQuickCharge(); Console.WriteLine(color2.GetColorType()); Console.WriteLine(battery2.GetBatteryType()); Console.WriteLine(quickcharge2.GetQuickChargeType()); Console.ReadLine(); Console.WriteLine("------------------------------------------"); Console.ReadLine(); Console.WriteLine("This is a Lower-end smartphone of IPhone Factory"); ICellPhoneFactory cellPhoneFactory3 = new IPhoneFactory(); ICellPhone iphone = cellPhoneFactory.GetLowerEnd(); IColor color3 = iphone.GetColor(); IBattery battery3 = iphone.GetBattery(); IQuickCharge quickcharge3 = iphone.GetQuickCharge(); Console.WriteLine(color3.GetColorType()); Console.WriteLine(battery3.GetBatteryType()); Console.WriteLine(quickcharge3.GetQuickChargeType()); Console.ReadLine(); }
public Samsung(IColor color, IBattery battery, IQuickCharge quickcharge) { _color = color; _battery = battery; _quickcharge = quickcharge; }
public IPhone(IColor color, IBattery battery, IQuickCharge quickcharge) { _color = color; _battery = battery; _quickcharge = quickcharge; }