CryEngine.Utilities.AssemblyReferenceHandler.GetRequiredAssembliesFromSource C# (CSharp) Method

GetRequiredAssembliesFromSource() public method

Gets the required assemblies for the source file passed to the method. Note: Does NOT exclude assemblies already loaded by CryMono.
public GetRequiredAssembliesFromSource ( string sources ) : string[]
sources string
return string[]
        public string[] GetRequiredAssembliesFromSource(string[] sources)
        {
            if(sources == null || sources.Length <= 0)
                return null;

            var namespaces = new List<string>();

            foreach(var line in sources)
            {
                //Filter for using statements
                var matches = Regex.Matches(line, @"using ([^;]+);");
                foreach(Match match in matches)
                {
                    string foundNamespace = match.Groups[1].Value;
                    if(!namespaces.Contains(foundNamespace))
                    {
                        namespaces.Add(foundNamespace);
                    }
                }
            }

            return namespaces.ToArray();
        }