public override int CompareTo(ALocation comparable) { LocationShortcut location = (LocationShortcut)comparable; int result = ev.CompareTo(location.ev); if (result == 0) result = path.CompareTo(location.path); return result; }
// Return location holders based on various kinds of input public virtual DetectedLocations getPaths(ALocation get_me) { Type check = get_me.GetType(); if (check.Equals(typeof(ScummVM))) { return(getPaths(get_me as ScummVM)); } else if (check.IsSubclassOf(typeof(APlayStationID))) { return(getPaths(get_me as APlayStationID)); } else if (check.Equals(typeof(LocationPath)) || check.IsSubclassOf(typeof(LocationPath))) { return(getPaths(get_me as LocationPath)); } else if (check.Equals(typeof(LocationRegistry))) { return(getPaths(get_me as LocationRegistry)); } else if (check.Equals(typeof(LocationShortcut))) { return(getPaths(get_me as LocationShortcut)); } else { throw new NotSupportedException(get_me.GetType().ToString()); } // return new DetectedLocations(); }
public override int CompareTo(ALocation comparable) { LocationRegistry location = (LocationRegistry)comparable; int result = compare(Root, location.Root); if (result == 0) result = compare(Key, location.Key); if (result == 0) result = compare(Value, location.Value); return result; }
public DetectedLocations getPaths(ALocation get_me) { DetectedLocations return_me = new DetectedLocations(); foreach (KeyValuePair <HandlerType, ALocationHandler> handler in handlers) { return_me.AddRange(handler.Value.getPaths(get_me)); } return(return_me); }
public void addLocation(ALocation loc) { if (loc is LocationPath) { this.Paths.Add(loc as LocationPath); } else if (loc is LocationRegistry) { this.Registries.Add(loc as LocationRegistry); } else { throw new NotSupportedException(loc.GetType().ToString()); } this.XML.AppendChild(loc.XML); }
public override int CompareTo(ALocation comparable) { return(this.ToString().CompareTo(comparable.ToString())); }
public override int CompareTo(ALocation comparable) { LocationParent location = (LocationParent)comparable; return game.CompareTo(location.game); }
public DetectedLocations getPaths(ALocation get_me) { DetectedLocations return_me = new DetectedLocations(); foreach (KeyValuePair<HandlerType, ALocationHandler> handler in handlers) { return_me.AddRange(handler.Value.getPaths(get_me)); } return return_me; }
public override int CompareTo(ALocation comparable) { return this.ToString().CompareTo(comparable.ToString()); }
public override int CompareTo(ALocation comparable) { ScummVM scumm = comparable as ScummVM; return this.Name.CompareTo(scumm.Name); }
public override int CompareTo(ALocation comparable) { APlayStationID id = comparable as APlayStationID; int result = 0; result = compare(this.prefix, id.prefix); if (result == 0) result = compare(this.suffix, id.suffix); if (result == 0) result = compare(this.append, id.append); return result; }
public void addLocation(ALocation loc) { Locations.addLocation(loc); }
// Pre-0.10 MASGAU didn't embed a path hash public ArchiveID(XmlElement root) { foreach (XmlElement element in root.ChildNodes) { switch (element.Name) { case "game": Game = new GameID(element); foreach (XmlAttribute attr in element.Attributes) { if (GameIdentifier.attributes.Contains(attr.Name) || attr.Name == "name") { continue; } throw new NotSupportedException(attr.Name); } break; case "archive": foreach (XmlAttribute attr in element.Attributes) { switch (attr.Name) { case "type": Type = attr.Value; break; default: throw new NotSupportedException(attr.Name); } } break; case "original_location": OriginalLocation = element.InnerText; break; case "original_relative_path": OriginalRelativePath = element.InnerText; break; case "original_ev": OriginalEV = ALocation.parseEnvironmentVariable(element.InnerText); break; case "owner": if (!element.HasAttribute("name")) { throw new Exception("NAME MISSING FROM ARCHIVES"); } Owner = element.GetAttribute("name"); break; case "original_location_hash": case "original_drive": break; default: throw new NotSupportedException(element.Name); } } }