/// <summary> /// Quick and very dirty way of getting the next stage in an open road race /// </summary> /// <param name="openRoadTrack"></param> /// <returns></returns> public static TrackDescription GetNextOpenRoadStage(TrackDescription openRoadTrack) { string lookForNumber = Path.GetFileNameWithoutExtension(openRoadTrack.FileName).Substring(2); lookForNumber = (int.Parse(lookForNumber) + 1).ToString(); return(_trackDescriptions.Find(delegate(TrackDescription track) { if (Path.GetFileName(track.FileName).StartsWith(Path.GetFileName(openRoadTrack.FileName).Substring(0, 2))) { if (Path.GetFileNameWithoutExtension(track.FileName).EndsWith(lookForNumber)) { return true; } } return false; })); }
/// <summary> /// Quick and very dirty way of getting the next stage in an open road race /// </summary> /// <param name="openRoadTrack"></param> /// <returns></returns> public static TrackDescription GetNextOpenRoadStage(TrackDescription openRoadTrack) { string lookForNumber = Path.GetFileNameWithoutExtension(openRoadTrack.FileName).Substring(2); lookForNumber = (int.Parse(lookForNumber)+1).ToString(); return _trackDescriptions.Find(delegate(TrackDescription track) { if (Path.GetFileName(track.FileName).StartsWith(Path.GetFileName(openRoadTrack.FileName).Substring(0, 2))) { if (Path.GetFileNameWithoutExtension(track.FileName).EndsWith(lookForNumber)) return true; } return false; }); }