Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #3
0
 internal DeferedCallDescriptor(DeferedCall callback, int numberOfFrames, params object[] args)
 {
     Callback       = callback;
     NumberOfFrames = numberOfFrames;
     Args           = args;
 }
Beispiel #4
0
 internal DeferedCallDescriptor(DeferedCall callback, int numberOfFrames, params object[] args)
 {
     Callback = callback;
     NumberOfFrames = numberOfFrames;
     Args = args;
 }