Example #1
0
        public ObjectTranslator(Lua interpreter, LuaState luaState)
        {
            _tagPtr          = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)));
            this.interpreter = interpreter;
            typeChecker      = new CheckType(this);
            metaFunctions    = new MetaFunctions(this);
            assemblies       = new List <Assembly>();

            CreateLuaObjectList(luaState);
            CreateIndexingMetaFunction(luaState);
            CreateBaseClassMetatable(luaState);
            CreateClassMetatable(luaState);
            CreateFunctionMetatable(luaState);
            SetGlobalFunctions(luaState);
        }
Example #2
0
		public ObjectTranslator (Lua interpreter, LuaCore.lua_State luaState)
		{
			this.interpreter = interpreter;
			typeChecker = new CheckType (this);
			metaFunctions = new MetaFunctions (this);
			assemblies = new List<Assembly> ();

			importTypeFunction = new LuaCore.lua_CFunction (ObjectTranslator.importType);
			loadAssemblyFunction = new LuaCore.lua_CFunction (ObjectTranslator.loadAssembly);
			registerTableFunction = new LuaCore.lua_CFunction (ObjectTranslator.registerTable);
			unregisterTableFunction = new LuaCore.lua_CFunction (ObjectTranslator.unregisterTable);
			getMethodSigFunction = new LuaCore.lua_CFunction (ObjectTranslator.getMethodSignature);
			getConstructorSigFunction = new LuaCore.lua_CFunction (ObjectTranslator.getConstructorSignature);

			createLuaObjectList (luaState);
			createIndexingMetaFunction (luaState);
			createBaseClassMetatable (luaState);
			createClassMetatable (luaState);
			createFunctionMetatable (luaState);
			setGlobalFunctions (luaState);
		}
Example #3
0
        public ObjectTranslator(Lua interpreter, LuaCore.lua_State luaState)
        {
            this.interpreter = interpreter;
            typeChecker      = new CheckType(this);
            metaFunctions    = new MetaFunctions(this);
            assemblies       = new List <Assembly> ();

            importTypeFunction        = new LuaCore.lua_CFunction(ObjectTranslator.importType);
            loadAssemblyFunction      = new LuaCore.lua_CFunction(ObjectTranslator.loadAssembly);
            registerTableFunction     = new LuaCore.lua_CFunction(ObjectTranslator.registerTable);
            unregisterTableFunction   = new LuaCore.lua_CFunction(ObjectTranslator.unregisterTable);
            getMethodSigFunction      = new LuaCore.lua_CFunction(ObjectTranslator.getMethodSignature);
            getConstructorSigFunction = new LuaCore.lua_CFunction(ObjectTranslator.getConstructorSignature);

            createLuaObjectList(luaState);
            createIndexingMetaFunction(luaState);
            createBaseClassMetatable(luaState);
            createClassMetatable(luaState);
            createFunctionMetatable(luaState);
            setGlobalFunctions(luaState);
        }
Example #4
0
        public ObjectTranslator(Lua interpreter, LuaState luaState)
        {
            this.interpreter = interpreter;
            typeChecker      = new CheckType(this);
            metaFunctions    = new MetaFunctions(this);
            assemblies       = new List <Assembly> ();

            importTypeFunction        = new LuaNativeFunction(ObjectTranslator.ImportType);
            loadAssemblyFunction      = new LuaNativeFunction(ObjectTranslator.LoadAssembly);
            registerTableFunction     = new LuaNativeFunction(ObjectTranslator.RegisterTable);
            unregisterTableFunction   = new LuaNativeFunction(ObjectTranslator.UnregisterTable);
            getMethodSigFunction      = new LuaNativeFunction(ObjectTranslator.GetMethodSignature);
            getConstructorSigFunction = new LuaNativeFunction(ObjectTranslator.GetConstructorSignature);
            ctypeFunction             = new LuaNativeFunction(ObjectTranslator.CType);
            enumFromIntFunction       = new LuaNativeFunction(ObjectTranslator.EnumFromInt);

            CreateLuaObjectList(luaState);
            CreateIndexingMetaFunction(luaState);
            CreateBaseClassMetatable(luaState);
            CreateClassMetatable(luaState);
            CreateFunctionMetatable(luaState);
            SetGlobalFunctions(luaState);
        }
Example #5
0
		public ObjectTranslator (Lua interpreter, LuaState luaState)
		{
			this.interpreter = interpreter;
			typeChecker = new CheckType (this);
			metaFunctions = new MetaFunctions (this);
			assemblies = new List<Assembly> ();

			importTypeFunction = new LuaNativeFunction (ObjectTranslator.ImportType);
			loadAssemblyFunction = new LuaNativeFunction (ObjectTranslator.LoadAssembly);
			registerTableFunction = new LuaNativeFunction (ObjectTranslator.RegisterTable);
			unregisterTableFunction = new LuaNativeFunction (ObjectTranslator.UnregisterTable);
			getMethodSigFunction = new LuaNativeFunction (ObjectTranslator.GetMethodSignature);
			getConstructorSigFunction = new LuaNativeFunction (ObjectTranslator.GetConstructorSignature);
			ctypeFunction = new LuaNativeFunction (ObjectTranslator.CType);
			enumFromIntFunction = new LuaNativeFunction (ObjectTranslator.EnumFromInt);

			CreateLuaObjectList (luaState);
			CreateIndexingMetaFunction (luaState);
			CreateBaseClassMetatable (luaState);
			CreateClassMetatable (luaState);
			CreateFunctionMetatable (luaState);
			SetGlobalFunctions (luaState);
		}
Example #6
0
        public ObjectTranslator(Lua interpreter, LuaState luaState)
        {
            _tagPtr          = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)));
            this.interpreter = interpreter;
            typeChecker      = new CheckType(this);
            metaFunctions    = new MetaFunctions(this);
            assemblies       = new List <Assembly>();

            _importTypeFunction        = ImportType;
            _loadAssemblyFunction      = LoadAssembly;
            _registerTableFunction     = RegisterTable;
            _unregisterTableFunction   = UnregisterTable;
            _getMethodSigFunction      = GetMethodSignature;
            _getConstructorSigFunction = GetConstructorSignature;
            _ctypeFunction             = CType;
            _enumFromIntFunction       = EnumFromInt;

            CreateLuaObjectList(luaState);
            CreateIndexingMetaFunction(luaState);
            CreateBaseClassMetatable(luaState);
            CreateClassMetatable(luaState);
            CreateFunctionMetatable(luaState);
            SetGlobalFunctions(luaState);
        }
Example #7
0
 internal static Array TableToArray(LuaState luaState, ExtractValue extractValue, Type paramArrayType, int startIndex, int count)
 {
     return(MetaFunctions.TableToArray(luaState, extractValue, paramArrayType, ref startIndex, count));
 }