mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 10:36:44 +00:00
Cleanup
This commit is contained in:
parent
d56a0d1a2a
commit
7628d4a29e
2 changed files with 5 additions and 19 deletions
|
@ -72,11 +72,6 @@ public class Machine : IComponent
|
|||
name = "getClipboard",
|
||||
function = L_GetClipboard,
|
||||
},
|
||||
new()
|
||||
{
|
||||
name = "task",
|
||||
function = L_Task,
|
||||
},
|
||||
new(),
|
||||
};
|
||||
|
||||
|
@ -92,20 +87,6 @@ public class Machine : IComponent
|
|||
return 1;
|
||||
}
|
||||
|
||||
private static int L_Task(IntPtr state)
|
||||
{
|
||||
var L = Lua.FromIntPtr(state);
|
||||
|
||||
var task = Objects.TaskMeta.Push(L, "test");
|
||||
task.Fulfill(lk => {
|
||||
lk.NewTable();
|
||||
lk.PushString("value");
|
||||
lk.SetField(-2, "key");
|
||||
});
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int L_Shutdown(IntPtr _)
|
||||
{
|
||||
RuntimeManager.Shutdown();
|
||||
|
|
|
@ -178,6 +178,11 @@ public class TaskMeta : IComponent
|
|||
|
||||
public static RuntimeTask Push(Lua L, string typeName)
|
||||
{
|
||||
if(!tasks.CheckStack(1))
|
||||
{
|
||||
L.Error("tasks limit exceeded");
|
||||
}
|
||||
|
||||
var task = new RuntimeTask(typeName);
|
||||
|
||||
ObjectManager.PushObject(L, task);
|
||||
|
|
Loading…
Reference in a new issue