Add a method to look up actors by ID.

This can be used to speed up some methods.
This commit is contained in:
RoosterDragon
2015-07-23 00:13:29 +01:00
parent d8ca66bec5
commit a0117a3890
3 changed files with 20 additions and 27 deletions

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
/* create a group */
var actors = order.TargetString.Split(',')
.Select(id => uint.Parse(id, NumberStyles.Any, NumberFormatInfo.InvariantInfo))
.Select(id => self.World.Actors.FirstOrDefault(a => a.ActorID == id))
.Select(id => self.World.GetActorById(id))
.Where(a => a != null);
new Group(actors);