public BindType(Type t) { type = t; name = LuaExport.GetTypeStr(t); if (t.IsGenericType) { libName = LuaExport.GetGenericLibName(t); wrapName = LuaExport.GetGenericLibName(t); } else { libName = t.FullName.Replace("+", "."); wrapName = name.Replace('.', '_'); if (name == "object") { wrapName = "System_Object"; } } if (t.BaseType != null) { baseName = LuaExport.GetTypeStr(t.BaseType); if (baseName == "ValueType") { baseName = null; } } if (t.GetConstructor(Type.EmptyTypes) == null && t.IsAbstract && t.IsSealed) { baseName = null; IsStatic = true; } }
private static string[] GetGenericName(Type[] types) { string[] results = new string[types.Length]; for (int i = 0; i < types.Length; i++) { if (types[i].IsGenericType) { results[i] = GetGenericName(types[i]); } else { results[i] = LuaExport.GetTypeStr(types[i]); } } return(results); }