Ejemplo n.º 1
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);
		}
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
		}
Ejemplo n.º 4
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);
        }