GetTargetQueue -> GetTargets + Exts

This commit is contained in:
alzeih
2011-04-05 21:40:52 +12:00
committed by Paul Chote
parent 820f67e46b
commit 0a67c68c45
13 changed files with 26 additions and 45 deletions

View File

@@ -32,10 +32,19 @@ namespace OpenRA.Traits.Activities
else
NextActivity = activity;
}
public virtual IEnumerable<Target> GetTargetQueue( Actor self )
public virtual IEnumerable<Target> GetTargets( Actor self )
{
yield break;
}
}
public static class ActivityExts
{
public static IEnumerable<Target> GetTargetQueue( this Actor self )
{
return self.GetCurrentActivity().Iterate( u => u.NextActivity ).TakeWhile( u => u != null )
.SelectMany( u => u.GetTargets( self ) );
}
}
}

View File

@@ -237,7 +237,7 @@ namespace OpenRA.Traits
if (activity != null && mobile != null)
{
var alt = new float2(0, -mobile.Altitude);
var targets = activity.GetTargetQueue(self);
var targets = activity.GetTargets(self);
var start = self.CenterLocation + alt;
var c = Color.Green;