Replace ActorInfo.Traits.WithInterface with ActorInfo.TraitInfos<T>()

This commit is contained in:
atlimit8
2015-09-19 13:22:00 -05:00
parent 6e39a5e264
commit 9acf121eb1
48 changed files with 76 additions and 77 deletions

View File

@@ -53,8 +53,8 @@ namespace OpenRA
static FactionInfo ChooseFaction(World world, string name, bool requireSelectable = true)
{
var selectableFactions = world.Map.Rules.Actors["world"].Traits
.WithInterface<FactionInfo>().Where(f => !requireSelectable || f.Selectable)
var selectableFactions = world.Map.Rules.Actors["world"].TraitInfos<FactionInfo>()
.Where(f => !requireSelectable || f.Selectable)
.ToList();
var selected = selectableFactions.FirstOrDefault(f => f.InternalName == name)
@@ -75,7 +75,7 @@ namespace OpenRA
static FactionInfo ChooseDisplayFaction(World world, string factionName)
{
var factions = world.Map.Rules.Actors["world"].Traits.WithInterface<FactionInfo>().ToArray();
var factions = world.Map.Rules.Actors["world"].TraitInfos<FactionInfo>().ToArray();
return factions.FirstOrDefault(f => f.InternalName == factionName) ?? factions.First();
}