Moved footprint info onto its building.

This commit is contained in:
Bob
2009-10-20 23:55:57 +13:00
parent 6c0ced3e9a
commit cfa56a791d
16 changed files with 607 additions and 385 deletions

View File

@@ -39,10 +39,15 @@ namespace OpenRa.Game.GameRules
var parts = x.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
var ret = Array.CreateInstance( fieldType.GetElementType(), parts.Length );
for (int i = 0; i < parts.Length; i++)
for( int i = 0 ; i < parts.Length ; i++ )
ret.SetValue( GetValue( fieldType.GetElementType(), parts[ i ].Trim() ), i );
return ret;
}
else if( fieldType == typeof( int2 ) )
{
var parts = x.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
return new int2( int.Parse( parts[ 0 ] ), int.Parse( parts[ 1 ] ) );
}
else
throw new InvalidOperationException( "FieldLoader: don't know how to load field of type " + fieldType.ToString() );
}