예제 #1
0
 /// <summary>
 /// Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback,
 /// although it's not always possible to use it. When a function (callback or script closure) returns a
 /// TailCallRequest, the bytecode processor immediately executes the function contained in the request.
 /// By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number
 /// of functionality (state savings, coroutines, etc) keeps working at full power.
 /// </summary>
 /// <param name="tailCallData">The data for the tail call.</param>
 /// <returns></returns>
 public static DynValue NewTailCallReq(TailCallData tailCallData)
 {
     return(new DynValue()
     {
         m_Object = tailCallData,
         m_Type = DataType.TailCallRequest,
     });
 }
예제 #2
0
        /// <summary>
        /// Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback,
        /// although it's not always possible to use it. When a function (callback or script closure) returns a
        /// TailCallRequest, the bytecode processor immediately executes the function contained in the request.
        /// By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number
        /// of functionality (state savings, coroutines, etc) keeps working at full power.
        /// </summary>
        /// <param name="tailCallData">The data for the tail call.</param>
        /// <returns></returns>
        public static DynValue NewTailCallReq(TailCallData tailCallData)
        {
            var d = Request();

            d.m_Object = tailCallData;
            d.m_Type   = DataType.TailCallRequest;
            return(d);
        }
예제 #3
0
 /// <summary>
 /// Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback,
 /// although it's not always possible to use it. When a function (callback or script closure) returns a
 /// TailCallRequest, the bytecode processor immediately executes the function contained in the request.
 /// By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number
 /// of functionality (state savings, coroutines, etc) keeps working at full power.
 /// </summary>
 /// <param name="tailCallData">The data for the tail call.</param>
 public static DynValue NewTailCallReq(TailCallData tailCallData)
 {
     return(new DynValue
     {
         _object = tailCallData,
         Type = DataType.TailCallRequest
     });
 }