Skip to content

Commit

Permalink
Automatic merge of X1.3.1-195-g6502efe3d and 8 pull requests
Browse files Browse the repository at this point in the history
- Pull request #40 at e81861b: Monogame upgrade
- Pull request #79 at 7d9f14b: Update version calculation for new unstable versions
- Pull request #216 at 927a49c: Upgrade and replace web server with EmbedIO
- Pull request #226 at 26983e9: EmbedIO web server graphical track monitor
- Pull request #227 at 6ec1539: EmbedIO web server graphical train driving monitor
- Pull request #228 at 72c0146: adds links to OR on Elvas Tower
- Pull request #232 at 699c09a: JSON consist format: https://blueprints.launchpad.net/or/+spec/consist-editor
- Pull request #234 at 3ac34fe: Rehabilitate unit testing suite, migrate to xUnit 2
  • Loading branch information
openrails-bot committed Jul 24, 2020
10 parents 649cc5c + 6502efe + e81861b + 7d9f14b + 927a49c + 26983e9 + 6ec1539 + 72c0146 + 699c09a + 3ac34fe commit cc5a388
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Source/ORTS.Common/TrainFile.cs
Expand Up @@ -225,10 +225,15 @@ public static string ResolveEngineFile(string basePath, string[] subFolders, str
/// <returns>All files with known train or consist file extensions.</returns>
public static IEnumerable<string> AllTrainFiles(string basePath)
{
ISet<string> BaseNames(string directory, string pattern) => new HashSet<string>(
Directory.GetFileSystemEntries(directory, pattern)
.Select((string path) => Path.GetFileNameWithoutExtension(path)),
StringComparer.InvariantCultureIgnoreCase);
ISet<string> BaseNames(string directory, string pattern)
{
if (!Directory.Exists(directory))
return new HashSet<string>();
return new HashSet<string>(
Directory.GetFileSystemEntries(directory, pattern)
.Select((string path) => Path.GetFileNameWithoutExtension(path)),
StringComparer.InvariantCultureIgnoreCase);
}

ISet<string> ortsBaseNames = BaseNames(Path.Combine(basePath, "trains", "lists"), "*.train-or");
ISet<string> mstsBaseNames = BaseNames(Path.Combine(basePath, "trains", "consists"), "*.con");
Expand Down

0 comments on commit cc5a388

Please sign in to comment.