public override void RunApp() { _car = new Car(); _phone = new JamesBondPhone(_car); _phone.RunCommand(1);//active stereo _writter.WriteLine(_car.ToString()); _writter.WriteLine("\n\n"); _phone.RunCommand(3);//active engine _phone.RunCommand(4);//set transmission to auto type _writter.WriteLine("\n\n"); _writter.WriteLine(_car.ToString()); }
public JamesBondPhone(Car car) { _car = car; _carCommands = new List<ICommand>(); LoadSimpleCommandList(); }
/// <summary> /// Only for example. In second constructor we send Car such as object - and it a good choise but very /// bad for understanding /// </summary> public JamesBondPhone() { _car = new Car(); _carCommands = new List<ICommand>(); LoadSimpleCommandList(); }