Replace ActorInfo.Traits.WithInterface with ActorInfo.TraitInfos<T>()
This commit is contained in:
@@ -170,7 +170,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
var renderSprites = actorInfo.TraitInfoOrDefault<RenderSpritesInfo>();
|
||||
AsSprite = renderSprites == null ? null : renderSprites.GetImage(actorInfo, self.World.Map.SequenceProvider, newOwner.Faction.InternalName);
|
||||
AsPlayer = newOwner;
|
||||
AsTooltipInfo = actorInfo.Traits.WithInterface<TooltipInfo>().FirstOrDefault();
|
||||
AsTooltipInfo = actorInfo.TraitInfos<TooltipInfo>().FirstOrDefault();
|
||||
|
||||
HandleDisguise(oldEffectiveOwner, oldDisguiseSetting);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
if (!info.ValidStances.HasStance(stance))
|
||||
return false;
|
||||
|
||||
return target.Info.Traits.WithInterface<ITargetableInfo>().Any(t => info.Types.Overlaps(t.GetTargetTypes()));
|
||||
return target.Info.TraitInfos<ITargetableInfo>().Any(t => info.Types.Overlaps(t.GetTargetTypes()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
// TODO: remove all the Render*Circle duplication
|
||||
class RenderJammerCircleInfo : ITraitInfo, IPlaceBuildingDecoration
|
||||
class RenderJammerCircleInfo : ITraitInfo, IPlaceBuildingDecorationInfo
|
||||
{
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
class RenderShroudCircleInfo : ITraitInfo, IPlaceBuildingDecoration
|
||||
class RenderShroudCircleInfo : ITraitInfo, IPlaceBuildingDecorationInfo
|
||||
{
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user