Move Shape from Health to new HitShape trait

Renamed Shape to Type
This commit is contained in:
reaperrr
2017-05-21 12:44:47 +02:00
parent c7c6cf864c
commit 43b55ae333
9 changed files with 87 additions and 51 deletions

View File

@@ -180,14 +180,14 @@ namespace OpenRA.Mods.Common
// TODO: Investigate caching this or moving it to ActorMapInfo
public static WDist MinimumRequiredVictimScanRadius(Ruleset rules)
{
return rules.Actors.SelectMany(a => a.Value.TraitInfos<HealthInfo>()).Max(h => h.Shape.OuterRadius);
return rules.Actors.SelectMany(a => a.Value.TraitInfos<HitShapeInfo>()).Max(h => h.Type.OuterRadius);
}
// TODO: Investigate caching this or moving it to ActorMapInfo
public static WDist MinimumRequiredBlockerScanRadius(Ruleset rules)
{
return rules.Actors.Where(a => a.Value.HasTraitInfo<IBlocksProjectilesInfo>())
.SelectMany(a => a.Value.TraitInfos<HealthInfo>()).Max(h => h.Shape.OuterRadius);
.SelectMany(a => a.Value.TraitInfos<HitShapeInfo>()).Max(h => h.Type.OuterRadius);
}
}
}