Example #1
0
        public static void RegisterCoreFunctions(State s)
        {
            s.PutGlobal("getmetatable", new State.NativeFuncDelegate(GetMetaTable));
            s.PutGlobal("setmetatable", new State.NativeFuncDelegate(SetMetaTable));

            s.PutGlobal("type", new State.NativeFuncDelegate(TypeString));
            s.PutGlobal("tonumber", new State.NativeFuncDelegate(ToNumber));

            s.PutGlobal("print", new State.NativeFuncDelegate(Print));

            s.PutGlobal("error", new State.NativeFuncDelegate(Error));
            s.PutGlobal("assert", new State.NativeFuncDelegate(Assert));
            s.PutGlobal("pcall", new State.NativeCoreFuncDelegate(PCall));

            s.PutGlobal("load", new State.NativeFuncDelegate(LoadString));

            s.PutGlobal("require", new State.NativeFuncDelegate(Require));

            s.PutGlobal("coroutine", GetCoroutineTable());
            s.PutGlobal("string", GetStringTable());
            s.PutGlobal("math", GetMathTable());
        }
Example #2
0
 public void SetGlobal(String name, State.NativeFuncDelegate userFunc)
 {
     LamnState.PutGlobal(name, userFunc);
 }
Example #3
0
 public LamnEngine()
 {
     LamnState = new State(this);
     CoreFunctions.RegisterCoreFunctions(LamnState);
 }