testing Inherits; seems to work. Also, the Converter knows a bit about Inherits now.

This commit is contained in:
Bob
2010-01-12 19:33:14 +13:00
parent b21e1adc2d
commit 0c473aa941
11 changed files with 50 additions and 132 deletions

View File

@@ -62,10 +62,11 @@ namespace OpenRa.Game.GameRules
.Where(x => Rules.UnitInfo[x].Owner.Contains(player.Race)); /* todo: fix for dual-race scenarios (captured buildings) */
}
public IEnumerable<NewUnitInfo> UnitBuiltAt( LegacyUnitInfo info )
public IEnumerable<NewUnitInfo> UnitBuiltAt( NewUnitInfo info )
{
if( info.BuiltAt.Length != 0 )
return info.BuiltAt.Select( x => Rules.NewUnitInfo[ x.ToLowerInvariant() ] );
var builtAt = info.Traits.Get<BuildableInfo>().BuiltAt;
if( builtAt.Length != 0 )
return builtAt.Select( x => Rules.NewUnitInfo[ x.ToLowerInvariant() ] );
else
return producesIndex[ Rules.UnitCategory[ info.Name ] ];
}