@@ -19,7 +19,7 @@ public sealed unsafe partial class LuaFunction : LuaReference
1919 public UpvalueCollection Upvalues => new ( this ) ;
2020
2121 [ DebuggerBrowsable ( DebuggerBrowsableState . Never ) ]
22- protected override LuaThread ? ThreadCore { get ; set ; }
22+ protected override Lua ? LuaCore { get ; set ; }
2323
2424 internal LuaFunction ( )
2525 { }
@@ -39,12 +39,12 @@ public LuaWeakReference<LuaFunction> CreateWeakReference()
3939
4040 private static void PrepareFunction ( LuaReference reference , out int top , int argumentCount )
4141 {
42- reference . Thread . Stack . EnsureFreeCapacity ( argumentCount + 1 ) ;
42+ reference . Lua . Stack . EnsureFreeCapacity ( argumentCount + 1 ) ;
4343
44- var L = reference . Thread . State . L ;
44+ var L = reference . Lua . State . L ;
4545 top = lua_gettop ( L ) ;
4646
47- reference . Thread . Stack . Push ( reference ) ;
47+ reference . Lua . Stack . Push ( reference ) ;
4848 }
4949
5050 internal static LuaFunctionResults PCall ( LuaThread thread , int oldTop , int argumentCount )
@@ -73,7 +73,7 @@ public LuaFunctionResults Call()
7373
7474 PrepareFunction ( this , out var top , 0 ) ;
7575
76- return PCall ( Thread , top , 0 ) ;
76+ return PCall ( Lua , top , 0 ) ;
7777 }
7878
7979 /// <summary>
@@ -92,13 +92,13 @@ public LuaFunctionResults Call<T>(T? argument)
9292
9393 try
9494 {
95- Thread . Stack . Push ( argument ) ;
95+ Lua . Stack . Push ( argument ) ;
9696
97- return PCall ( Thread , top , 1 ) ;
97+ return PCall ( Lua , top , 1 ) ;
9898 }
9999 catch
100100 {
101- lua_settop ( Thread . State . L , top ) ;
101+ lua_settop ( Lua . State . L , top ) ;
102102 throw ;
103103 }
104104 }
@@ -121,14 +121,14 @@ public LuaFunctionResults Call<T1, T2>(T1? argument1, T2? argument2)
121121
122122 try
123123 {
124- Thread . Stack . Push ( argument1 ) ;
125- Thread . Stack . Push ( argument2 ) ;
124+ Lua . Stack . Push ( argument1 ) ;
125+ Lua . Stack . Push ( argument2 ) ;
126126
127- return PCall ( Thread , top , 2 ) ;
127+ return PCall ( Lua , top , 2 ) ;
128128 }
129129 catch
130130 {
131- lua_settop ( Thread . State . L , top ) ;
131+ lua_settop ( Lua . State . L , top ) ;
132132 throw ;
133133 }
134134 }
@@ -153,15 +153,15 @@ public LuaFunctionResults Call<T1, T2, T3>(T1? argument1, T2? argument2, T3? arg
153153
154154 try
155155 {
156- Thread . Stack . Push ( argument1 ) ;
157- Thread . Stack . Push ( argument2 ) ;
158- Thread . Stack . Push ( argument3 ) ;
156+ Lua . Stack . Push ( argument1 ) ;
157+ Lua . Stack . Push ( argument2 ) ;
158+ Lua . Stack . Push ( argument3 ) ;
159159
160- return PCall ( Thread , top , 3 ) ;
160+ return PCall ( Lua , top , 3 ) ;
161161 }
162162 catch
163163 {
164- lua_settop ( Thread . State . L , top ) ;
164+ lua_settop ( Lua . State . L , top ) ;
165165 throw ;
166166 }
167167 }
@@ -188,16 +188,16 @@ public LuaFunctionResults Call<T1, T2, T3, T4>(T1? argument1, T2? argument2, T3?
188188
189189 try
190190 {
191- Thread . Stack . Push ( argument1 ) ;
192- Thread . Stack . Push ( argument2 ) ;
193- Thread . Stack . Push ( argument3 ) ;
194- Thread . Stack . Push ( argument4 ) ;
191+ Lua . Stack . Push ( argument1 ) ;
192+ Lua . Stack . Push ( argument2 ) ;
193+ Lua . Stack . Push ( argument3 ) ;
194+ Lua . Stack . Push ( argument4 ) ;
195195
196- return PCall ( Thread , top , 4 ) ;
196+ return PCall ( Lua , top , 4 ) ;
197197 }
198198 catch
199199 {
200- lua_settop ( Thread . State . L , top ) ;
200+ lua_settop ( Lua . State . L , top ) ;
201201 throw ;
202202 }
203203 }
@@ -233,14 +233,14 @@ public LuaFunctionResults Call(params ReadOnlySpan<object?> arguments)
233233 {
234234 foreach ( var argument in arguments )
235235 {
236- Thread . Stack . Push ( argument ) ;
236+ Lua . Stack . Push ( argument ) ;
237237 }
238238
239- return PCall ( Thread , top , argumentCount ) ;
239+ return PCall ( Lua , top , argumentCount ) ;
240240 }
241241 catch
242242 {
243- lua_settop ( Thread . State . L , top ) ;
243+ lua_settop ( Lua . State . L , top ) ;
244244 throw ;
245245 }
246246 }
@@ -276,14 +276,14 @@ public LuaFunctionResults Call(params ReadOnlySpan<LuaStackValue> arguments)
276276 {
277277 foreach ( var argument in arguments )
278278 {
279- Thread . Stack . Push ( argument ) ;
279+ Lua . Stack . Push ( argument ) ;
280280 }
281281
282- return PCall ( Thread , top , argumentCount ) ;
282+ return PCall ( Lua , top , argumentCount ) ;
283283 }
284284 catch
285285 {
286- lua_settop ( Thread . State . L , top ) ;
286+ lua_settop ( Lua . State . L , top ) ;
287287 throw ;
288288 }
289289 }
@@ -307,14 +307,14 @@ public LuaFunctionResults Call(LuaStackValueRange arguments)
307307 {
308308 foreach ( var argument in arguments )
309309 {
310- Thread . Stack . Push ( argument ) ;
310+ Lua . Stack . Push ( argument ) ;
311311 }
312312
313- return PCall ( Thread , top , argumentCount ) ;
313+ return PCall ( Lua , top , argumentCount ) ;
314314 }
315315 catch
316316 {
317- lua_settop ( Thread . State . L , top ) ;
317+ lua_settop ( Lua . State . L , top ) ;
318318 throw ;
319319 }
320320 }
0 commit comments