GameLoader.GameSuggestions.CheckFolder C# (CSharp) Method

CheckFolder() private static method

Checks if a folder match any know game library names
private static CheckFolder ( DirectoryInfo folder, List libraryLocations ) : bool
folder System.IO.DirectoryInfo The folder to check
libraryLocations List A list to add the folder to if it's valid
return bool
        private static bool CheckFolder(DirectoryInfo folder, List<string> libraryLocations)
        {
            // Check for steam libraries
            if (folder.Name.Equals("SteamLibrary", StringComparison.OrdinalIgnoreCase))
            {
                libraryLocations.Add(folder.FullName);
                return true;
            }
            // Check for origin libraries
            if (folder.Name.Equals("Origin Games", StringComparison.OrdinalIgnoreCase))
            {
                libraryLocations.Add(folder.FullName);
                return true;
            }
            // Check for the steam install itself
            if (folder.Name.Equals("Steam", StringComparison.OrdinalIgnoreCase))
            {
                // Make sure to get the correct sub folder
                libraryLocations.Add(FindSteamCommonsFolder(folder));
                return true;
            }
            // Check for a ubisoft install
            if (folder.Name.Equals("Ubisoft", StringComparison.OrdinalIgnoreCase))
            {
                // Make sure to get the correct subfolder
                libraryLocations.Add(FindUbisoftFolder(folder));
                return true;
            }
            // Check for a GOG client install
            if (folder.Name.Equals("GalaxyClient", StringComparison.OrdinalIgnoreCase))
            {
                // Make sure to get the correct sub folder
                libraryLocations.Add(FindGalaxyClientFolder(folder));
                return true;
            }
            // Check for any directories called "games" since they often contain games
            if (folder.Name.Equals("Games", StringComparison.OrdinalIgnoreCase))
            {
                libraryLocations.Add(folder.FullName);
                return true;
            }
            // The folder didn't match a know pattern, so we should search the sub folders
            return false;
        }