Remove PPos overload of FindUnits.

This commit is contained in:
Paul Chote
2013-07-20 14:02:44 +12:00
parent 800acdbdf2
commit 37c02fea79
7 changed files with 11 additions and 13 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA
{
public static IEnumerable<Actor> FindUnitsAtMouse(this World world, int2 mouseLocation)
{
var loc = Game.viewport.ViewToWorldPx(mouseLocation);
var loc = Game.viewport.ViewToWorldPx(mouseLocation).ToWPos(0);
return FindUnits(world, loc, loc).Where(a => !world.FogObscures(a));
}
@@ -34,11 +34,8 @@ namespace OpenRA
public static IEnumerable<Actor> FindUnits(this World world, WPos tl, WPos br)
{
return world.FindUnits(PPos.FromWPos(tl), PPos.FromWPos(br));
}
public static IEnumerable<Actor> FindUnits(this World world, PPos a, PPos b)
{
var a = PPos.FromWPos(tl);
var b = PPos.FromWPos(br);
var u = PPos.Min(a, b);
var v = PPos.Max(a, b);
return world.WorldActor.Trait<SpatialBins>().ActorsInBox(u,v);