combat actually works

This commit is contained in:
Chris Forbes
2009-10-21 21:34:34 +13:00
parent 659c3669e7
commit 4382a10568
9 changed files with 81 additions and 30 deletions

View File

@@ -142,6 +142,12 @@ namespace OpenRa.Game
return world.Actors
.Where(x => x.Bounds.IntersectsWith(rect));
}
public static IEnumerable<Actor> FindUnitsInCircle(float2 a, float r)
{
return FindUnits(a - new float2(r, r), a + new float2(r, r))
.Where(x => (x.CenterLocation - a).LengthSquared < r * r);
}
public static IEnumerable<Actor> SelectUnitsInBox(float2 a, float2 b)