Exemplo n.º 1
0
        /*
         * Gets an instance of an implementation of the klass interface or
         * subclass of klass that delegates public virtual methods to the
         * luaTable table.
         * Caches the generated type.
         */
        public object GetClassInstance(Type klass, LuaTable luaTable)
        {
            LuaClassType luaClassType;

            if (classCollection.ContainsKey(klass))
            {
                luaClassType = classCollection[klass];
            }
            else
            {
                luaClassType = new LuaClassType();
                GenerateClass(klass, out luaClassType.klass, out luaClassType.returnTypes);
                classCollection[klass] = luaClassType;
            }
            return(Activator.CreateInstance(luaClassType.klass, new object[] { luaTable, luaClassType.returnTypes }));
        }
 /*
  * Gets an instance of an implementation of the klass interface or
  * subclass of klass that delegates public virtual methods to the
  * luaTable table.
  * Caches the generated type.
  */
 public object GetClassInstance( Type klass, LuaTable luaTable )
 {
     LuaClassType luaClassType;
     if ( classCollection.ContainsKey( klass ) )
     {
         luaClassType = classCollection[klass];
     }
     else
     {
         luaClassType = new LuaClassType();
         GenerateClass( klass, out luaClassType.klass, out luaClassType.returnTypes );
         classCollection[klass] = luaClassType;
     }
     return Activator.CreateInstance( luaClassType.klass, new object[] { luaTable, luaClassType.returnTypes } );
 }