Add base lib for machine functions

This commit is contained in:
Alessandro Proto 2023-02-01 22:57:58 +01:00
parent 5af217ac1f
commit 1fbcef2146

View file

@ -0,0 +1,43 @@
using Capy64.API;
using KeraLua;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Capy64.Runtime.Libraries;
public class Machine : IPlugin
{
private static IGame _game;
public Machine(IGame game)
{
_game = game;
}
// todo list
// shutdown, reboot
// set, get title
// get proper version function
// set discord rpc
//
private static LuaRegister[] MachineLib = new LuaRegister[]
{
new(),
};
public void LuaInit(Lua L)
{
L.RequireF("machine", OpenLib, false);
}
private static int OpenLib(IntPtr state)
{
var L = Lua.FromIntPtr(state);
L.NewLib(MachineLib);
return 1;
}
}