protected override DetectedLocations getPaths(ScummVM get_me) { if (get_me.Name == "scummvm") Console.Out.Write(""); List<DetectedLocationPathHolder> paths = new List<DetectedLocationPathHolder>(); if (Locations == null) { setup(); } if (install_path != null) { paths.AddRange(loadLocations(install_path, get_me, null)); } DetectedLocations return_me = new DetectedLocations(); foreach (string user in Locations.Keys) { if (get_me.Name != "scummvm" && Locations[user].ContainsKey("scummvm")) { foreach (DetectedLocationPathHolder path in loadLocations(Locations[user]["scummvm"], get_me, user)) { DirectoryInfo info = new DirectoryInfo(path.FullDirPath); if (info.GetFiles(get_me.Name + "*").Length > 0) { return_me.Add(path); } } } if (Locations[user].ContainsKey(get_me.Name)) { return_me.AddRange(loadLocations(Locations[user][get_me.Name], get_me, user)); } } return return_me; }
//protected DetectedLocations filterLocations(DetectedLocations locs, ScummVM scumm, string user) { // List<string> keys = new List<string>(locs.Keys); // foreach (string key in keys) { // if (!filterLocation(locs[key], scumm, user)) { // locs.Remove(key); // } // } // return locs; //} protected bool filterLocation(DetectedLocationPathHolder loc, ScummVM scumm, string user) { DirectoryInfo dir = new DirectoryInfo(loc.FullDirPath); string pattern = scumm.Name + "*"; if (dir.GetFiles(pattern).Length > 0) { loc.owner = user; return true; } return false; }
protected override DetectedLocations getPaths(ScummVM get_me) { DetectedLocations locs = base.getPaths(get_me); if (install_path != null) { LocationPath loc = SystemLocationHandler.translateToVirtualStore(install_path); DetectedLocations vlocs = Core.locations.getPaths(loc); List<string> keys = new List<string>(vlocs.Keys); foreach (string key in keys) { if (!filterLocation(vlocs[key], get_me, vlocs[key].owner)) { locs.Remove(key); } } locs.AddRange(locs); } return locs; }
protected DetectedLocations loadLocations(String path, ScummVM scumm, string user) { DetectedLocations locs = Core.locations.interpretPath(path); return locs; }