private static IScriptStructure CreateComplexType(TypeReference type, IReadOnlyDictionary <GenericParameter, TypeReference> arguments) { type = GetElementType(type, arguments); if (IsEngineStruct(type)) { return(ScriptStructure.EngineTypeToScriptStructure(type.Name)); } PrimitiveType primType = ToPrimitiveType(type); if (primType == PrimitiveType.Complex) { if (IsEnginePointer(type)) { return(new ScriptPointer(type)); } else { return(new MonoStructure(type.Resolve(), arguments)); } } else { return(null); } }
private static IScriptStructure CreateComplexType(TypeReference type) { TypeReference elementType = GetElementType(type); if (IsEngineStruct(elementType)) { return(ScriptStructure.EngineTypeToScriptStructure(elementType.Name)); } TypeDefinition definition = elementType.Resolve(); if (definition.IsEnum) { return(null); } PrimitiveType primType = ToPrimitiveType(elementType); if (primType == PrimitiveType.Complex) { if (IsEnginePointer(elementType)) { return(new ScriptPointer(elementType)); } else { return(new MonoStructure(definition)); } } else { return(null); } }