Cache TargetablePositions in Actor

To speed up Target.Positions.
This commit is contained in:
reaperrr
2018-03-14 01:48:24 +01:00
committed by Paul Chote
parent 4c16e51f92
commit 0c52ff3ae5
5 changed files with 29 additions and 10 deletions

View File

@@ -73,6 +73,8 @@ namespace OpenRA.Mods.Common.Traits
base.Created(self);
}
bool ITargetablePositions.AlwaysEnabled { get { return Info.RequiresCondition == null; } }
IEnumerable<WPos> ITargetablePositions.TargetablePositions(Actor self)
{
if (IsTraitDisabled)

View File

@@ -334,8 +334,6 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<object> ActorPreviewInits(ActorInfo ai, ActorPreviewType type);
}
public interface IMoveInfo : ITraitInfoInterface { }
public interface IMove
{
Activity MoveTo(CPos cell, int nearEnough);