change NewUnitInfo to use a TypeDictionary

This commit is contained in:
Chris Forbes
2010-01-10 14:29:26 +13:00
parent be9fd1e277
commit 9add15464c
2 changed files with 4 additions and 5 deletions

View File

@@ -38,7 +38,7 @@ namespace OpenRa.Game
if( Info.Traits == null )
throw new InvalidOperationException( "No Actor traits for {0}; add Traits= to units.ini for appropriate unit".F(Info.Name) );
foreach (var trait in Rules.NewUnitInfo[Info.Name.ToLower()].Traits.Values)
foreach (var trait in Rules.NewUnitInfo[Info.Name.ToLower()].Traits.WithInterface<ITraitInfo>())
traits.Add(trait.Create(this));
}