mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Add base lib for machine functions
This commit is contained in:
parent
5af217ac1f
commit
1fbcef2146
1 changed files with 43 additions and 0 deletions
43
Capy64/Runtime/Libraries/Machine.cs
Normal file
43
Capy64/Runtime/Libraries/Machine.cs
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue