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