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

@@ -111,14 +111,14 @@ namespace OpenRA.Mods.Common.Lint
}
// TODO: HACK because GainsExperience grants upgrades differently to most other sources.
var gainsExperience = rules.Actors.SelectMany(x => x.Value.Traits.WithInterface<GainsExperienceInfo>()
var gainsExperience = rules.Actors.SelectMany(x => x.Value.TraitInfos<GainsExperienceInfo>()
.SelectMany(y => y.Upgrades.SelectMany(z => z.Value)));
foreach (var upgrade in gainsExperience)
yield return upgrade;
// TODO: HACK because Pluggable grants upgrades differently to most other sources.
var pluggable = rules.Actors.SelectMany(x => x.Value.Traits.WithInterface<PluggableInfo>()
var pluggable = rules.Actors.SelectMany(x => x.Value.TraitInfos<PluggableInfo>()
.SelectMany(y => y.Upgrades.SelectMany(z => z.Value)));
foreach (var upgrade in pluggable)
@@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Lint
// TODO: HACK because GainsExperience and GainsStatUpgrades do not play by the rules...
// We assume everything GainsExperience grants is used by GainsStatUpgrade
var gainsExperience = rules.Actors.SelectMany(x => x.Value.Traits.WithInterface<GainsExperienceInfo>()
var gainsExperience = rules.Actors.SelectMany(x => x.Value.TraitInfos<GainsExperienceInfo>()
.SelectMany(y => y.Upgrades.SelectMany(z => z.Value)));
foreach (var upgrade in gainsExperience)