public Duck(Idisplay display, ISwim swim, IFly fly, IKuak kuak) : this(display, swim, fly) { if (kuak != null) { _kuak = kuak; } }
public Duck(Idisplay display, ISwim swim, IFly fly) { if (display != null) { _display = display; } if (swim != null) { _swim = swim; } if (fly != null) { _fly = fly; } }
/// <summary> /// this the constructor of this object, it will create instance of the other classes /// whenever needed (_disp is the display class whenever we need to write anything in the console /// _calc for calculation whenever we need to make caluclation (consumable duration or number of stops) /// and _dataapi for bringing data from api) /// </summary> /// <param name="calc">it is the class calculation which is related to calculation</param> /// <param name="disp">the class specialized in displaying info</param> /// <param name="dataapi">class related to manipulating data from api</param> public businesslogic(Icalculations calc, Idisplay disp, Idatafromapi dataapi) { _calc = calc; _disp = disp; _dataapi = dataapi; }
/// <summary> /// constructor of the class and creation of the instance whenever needed /// </summary> /// <param name="disp">display class</param> public datafromapi(Idisplay disp) { _disp = disp; }
/// <summary> /// constructor of the class /// </summary> /// <param name="businesslogic">we need to initialise business logic class</param> /// <param name="disp">initialising the display class</param> public Application(Ibusinesslogic businesslogic, Idisplay disp) { _businesslogic = businesslogic; _disp = disp; }