예제 #1
0
        /// <summary>
        /// Defers the function call for a given number of frames
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="numberOfFrames"></param>
        /// <param name="args">The arguments that should be applied to a defered function</param>
        public void Defer(DeferedCall callback, int numberOfFrames, params object[] args)
        {
            if (numberOfFrames <= 0)
            {
                callback();
                return;
            }

            if (null == _deferredCalls) // go lazy
            {
                _deferredCalls = new List <DeferedCallDescriptor>();
            }

            _deferredCalls.Add(new DeferedCallDescriptor(callback, numberOfFrames, args));

            _hasDeferredCalls = true;
        }
예제 #2
0
        /// <summary>
        /// Defers the function call for a given number of frames
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="numberOfFrames"></param>
        /// <param name="args">The arguments that should be applied to a defered function</param>
        public void Defer(DeferedCall callback, int numberOfFrames, params object[] args)
        {
            if (numberOfFrames <= 0)
            {
                callback();
                return;
            }

            if (null == _deferredCalls) // go lazy
                _deferredCalls = new List<DeferedCallDescriptor>();

            _deferredCalls.Add(new DeferedCallDescriptor(callback, numberOfFrames, args));

            _hasDeferredCalls = true;
        }
예제 #3
0
 internal DeferedCallDescriptor(DeferedCall callback, int numberOfFrames, params object[] args)
 {
     Callback       = callback;
     NumberOfFrames = numberOfFrames;
     Args           = args;
 }
예제 #4
0
 internal DeferedCallDescriptor(DeferedCall callback, int numberOfFrames, params object[] args)
 {
     Callback = callback;
     NumberOfFrames = numberOfFrames;
     Args = args;
 }