BrickPi.Movement.Vehicule.RunUntil C# (CSharp) Method

RunUntil() private method

private RunUntil ( object state ) : void
state object
return void
        private void RunUntil(object state)
        {
            if (state == null)
                return;
            //stop all motors!
            BrickPortMotor[] ports = (BrickPortMotor[])state;
            for (int i = 0; i < ports.Length; i++)
            {
                StopMotor((int)ports[i]);
            }
            if(timer!=null)
            {
                timer.Dispose();
                timer = null;
            }
        }