コード例 #1
0
ファイル: ObjectTranslator.cs プロジェクト: Azhei/NLua
		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);
		}
コード例 #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);
        }
コード例 #3
0
ファイル: ObjectTranslator.cs プロジェクト: GSharpDevs/RunG
		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);
		}
コード例 #4
0
ファイル: ObjectTranslator.cs プロジェクト: xrw002/NLua
        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);
        }