/// <summary>
        /// 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.
        /// </summary>
        public object GetClassInstance(Type klass, LuaTable luaTable)
        {
            LuaClassType luaClassType;

            if (!classCollection.TryGetValue(klass, out luaClassType))
            {
                luaClassType = new LuaClassType();
                GenerateClass(klass, out luaClassType.klass, out luaClassType.returnTypes, luaTable);
                classCollection[klass] = luaClassType;
            }
            return(Activator.CreateInstance(luaClassType.klass, new object[] { luaTable, luaClassType.returnTypes }));
        }
Ejemplo n.º 2
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,luaTable);
         classCollection[klass] = luaClassType;
     }
     return Activator.CreateInstance(luaClassType.klass,new object[] {luaTable,luaClassType.returnTypes});
 }
Ejemplo n.º 4
0
 public object GetClassInstance(Type klass, LuaTable luaTable)
 {
     LuaClassType type;
     if (this.classCollection.ContainsKey(klass))
     {
         type = this.classCollection[klass];
     }
     else
     {
         type = new LuaClassType();
         this.GenerateClass(klass, out type.klass, out type.returnTypes);
         this.classCollection[klass] = type;
     }
     return Activator.CreateInstance(type.klass, new object[] { luaTable, type.returnTypes });
 }