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 ) );
}
}
}