Theater definitions in yaml

This commit is contained in:
Paul Chote
2010-03-04 18:26:43 +13:00
parent 1914a8adbe
commit 724928cf56
10 changed files with 82 additions and 16 deletions

View File

@@ -28,7 +28,7 @@ namespace OpenRA.FileFormats
{
public readonly Dictionary<ushort, Terrain> tiles = new Dictionary<ushort, Terrain>();
public readonly Walkability Walkability = new Walkability();
public readonly Walkability Walkability;
public readonly Dictionary<ushort, TileTemplate> walk
= new Dictionary<ushort, TileTemplate>();
@@ -46,12 +46,12 @@ namespace OpenRA.FileFormats
return ret;
}
public TileSet( string suffix )
public TileSet( string tilesetFile, string templatesFile, string suffix )
{
Walkability = new Walkability();
Walkability = new Walkability(templatesFile);
char tileSetChar = char.ToUpperInvariant( suffix[ 1 ] );
StreamReader tileIdFile = new StreamReader( FileSystem.Open( "tileSet.til" ) );
char tileSetChar = char.ToUpperInvariant( suffix[ 0 ] );
StreamReader tileIdFile = new StreamReader( FileSystem.Open(tilesetFile) );
while( true )
{
@@ -74,7 +74,7 @@ namespace OpenRA.FileFormats
if (!walk.ContainsKey((ushort)(start + i)))
walk.Add((ushort)(start + i), Walkability.GetWalkability(tilename));
using( Stream s = FileSystem.Open( tilename + suffix ) )
using( Stream s = FileSystem.Open( tilename + "." + suffix ) )
{
if( !tiles.ContainsKey( (ushort)( start + i ) ) )
tiles.Add( (ushort)( start + i ), new Terrain( s ) );