//------------------------------------------------------------------ public void Accelerate(Composite action, int times = 1) { if (driver.Car.Velocity >= driver.Velocity) return; foreach (var i in Enumerable.Range (0, times)) driver.Car.Accelerate(); }
//------------------------------------------------------------------ public void Accelerate(Composite action, int times = 1) { if (Car.Velocity < Car.Driver.Velocity) action.Add (new Repeated (Car.Accelerate, times) {Name = "Accelerate"}); }
//------------------------------------------------------------------ public void Brake(Composite action, int times = 1) { action.Add (new Repeated (Car.Brake, times) {Name = "Brake"}); }