added Exists() to FileSystem

This commit is contained in:
Chris Forbes
2010-01-02 21:58:46 +13:00
parent 0a7ffc8cc9
commit c198596df0

View File

@@ -73,5 +73,20 @@ namespace OpenRa.FileFormats
throw new FileNotFoundException( string.Format( "File not found: {0}", filename ), filename );
}
public static bool Exists(string filename)
{
foreach (var folder in mountedFolders)
{
var s = folder.GetContent(filename);
if (s != null)
{
s.Dispose();
return true;
}
}
return false;
}
}
}