示例#1
0
        //------------------------------------------------------------------
        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();
        }
示例#2
0
 //------------------------------------------------------------------
 public void Accelerate(Composite action, int times = 1)
 {
     if (Car.Velocity < Car.Driver.Velocity)
         action.Add (new Repeated (Car.Accelerate, times) {Name = "Accelerate"});
 }
示例#3
0
 //------------------------------------------------------------------
 public void Brake(Composite action, int times = 1)
 {
     action.Add (new Repeated (Car.Brake, times) {Name = "Brake"});
 }