Fix for loading yaml from a mounted package/folder

This commit is contained in:
Paul Chote
2010-04-02 02:21:27 +13:00
committed by Bob
parent 1af84c9b1b
commit 586266d2dc
6 changed files with 196 additions and 4 deletions

View File

@@ -83,8 +83,20 @@ namespace OpenRA.FileFormats
return levels[0];
}
public static Dictionary<string, MiniYaml> FromFile( string path )
public static Dictionary<string, MiniYaml> FromFileInPackage( string path )
{
StreamReader reader = new StreamReader( FileSystem.Open(path) );
List<string> lines = new List<string>();
while( !reader.EndOfStream )
lines.Add(reader.ReadLine());
reader.Close();
return FromLines(lines.ToArray());
}
public static Dictionary<string, MiniYaml> FromFile( string path )
{
return FromLines(File.ReadAllLines( path ));
}